I'm using the same ultragrid to allow users to edit row data for different tables. So each time they select a table to edit I bind it to the same ultragrid. This all works very well. But, if going from one table to another, and the tables share columns with the same name, the size of those columns (the similar ones) get very wide and the distinct columns get forced very small. Before I start using the grid I set its AutoFitStyle to ResizeAllColumns so my hope was that the columns would be evenly spaced each time I bind to a table.
Any thoughts on why this might be happening or is there a call I can make between binding from one table to another to 'reset' the columns so they are more evenly spaced... similar to when the grid was initially populated the first time?
I am using 12.1 Win.
Thanks!
Hi,
I'm not really sure I understand exactly what you mean. Can you post screen shots of what you are seeing?
If you are re-binding the grid to a new data source that has exactly the same structure as the old data source, then the column widths shouldn't change. But it's possible that the grid is re-applying the adjustments for the AutoFitStyle each time.
Whatever the issue is, you might be able to get around it by saving the layout before you change the DataSource, and then re-loading it afterward.
Hey,
thanks for the quick response... this morning I found the PerformAutoResizeColumns() method on the layout of the grid... I simply call it in InitializeLayout of the grid and every looks exactly as I want.
Thanks again for your time with this!