I'm assigning the dataset of one grid with a button. After that assignment I want the column size of another grid to mimic the grid I just assigned the dataset to. However I couldnt find an event thats will run after the new dataset gets loaded the UI changeds for the new grid. The code I'm using is simple I just cant get it to run after the UI is updated.
for (int ii = 0; ii < ultraGridHeaders.DisplayLayout.Bands[0].Columns.Count; ii++)
{ ultraGridHeaders.DisplayLayout.Bands[0].Columns[ii].Width = ultraGrid1.DisplayLayout.Bands[0].Columns[ii].Width;}
Worked perfectly thankyou
Oh, I see.
What new widths are you referring to? The default column widths that the grid is using for the columns? Or is the grid autosizing the columns (based on the AllowColSizing property)?
Either way, I think this should be easy enough to get around. Here what I would try:
well if I use that code right after assigning the dataset the UI hasnt been changed yet with the new widths.
Hi,
I don't think you need an event. Can't you just call this code immediately after setting the grid's DataSource.