Hi,
I am resizing all columns of an ultraWinGrid using the following (looping over all columns)
for (int i = 0; i < ClientsView.DisplayLayout.Bands[0].Columns.Count;i++ ) ClientsView.DisplayLayout.Bands[0].Columns[i].PerformAutoResize(Infragistics.Win.UltraWinGrid.PerformAutoSizeType.AllRowsInBand);
I was wondering if there is a better substitute (of looping over all Columns and Bands). I came across the following (in one of Infragistics articles)
ClientsView.DisplayLayout.Override.AllowColSizing = Infragistics.Win.UltraWinGrid.AllowColSizing.Synchronized;ClientsView.DisplayLayout.Override.ColumnAutoSizeMode = Infragistics.Win.UltraWinGrid.ColumnAutoSizeMode.VisibleRows;ClientsView.DisplayLayout.Override.ColumnSizingArea = Infragistics.Win.UltraWinGrid.ColumnSizingArea.EntireColumn;
However, the above approach does not resize any column. Why is that so? What is the difference between the two approaches?
Any help will be highly appreciated.
Sameer
Hi Sameer,
If you have the latest version of NetAdvantage (v8.2), then some new methods were added to the Band and the DisplayLayout which does the looping for you and resizes all of the column. Look for PerformAutoResize on the Band or the DisplayLayout of the grid.
Regarding the other properties you have listed here, none of these properties autosizes anything. They are simply settings that determine how the autosizing is done when the user double-clicks between column headers.
I am using version 7.3, so I guess looping over every column and band is the only option for me.
Thanks for your reponse.