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
1834
Easy Way to Extend One Column After PerformAutoResize
posted

In my grid, I have a variety of columns, and I use PerformAutoResize to size them down.  The 'Name' column that I have is not the last column, so ExtendLastColumn won't do what I want, which is to shrink all columns except Name down and then extend out the Name column with all the remaining room.

What's the best way to do this?

Thanks,

J

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi J,

    Try something like this:

     


            private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {
                foreach (UltraGridColumn column in e.Layout.Bands[0].Columns)
                {
                    column.PerformAutoResize(PerformAutoSizeType.AllRowsInBand);
                    if (column.Key != "Name")
                    {
                        column.MinWidth = column.Width;
                        column.MaxWidth = column.Width;
                    }
                }

                e.Layout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
            }

Reply Children
No Data