Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
235
ColumnAutoSizeMode does not work
posted

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 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

     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. 

Children