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
785
Column sizing still a bug in .NET 2008?
posted

About a year ago I reported a bug where the grid would not size columns properly.  I will repeat it here to and see if anyone has a workaround.

  • I have a grid with 5 columns.
  • Columns 1, 4, 5 are fixed width (RowLayoutSizing.None).  Thus columns 2 and 3 are allowed to grow.
  • The grid is set to GridControl.DisplayLayout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.ExtendLastColumn.

When the Grid displays, the last column's Fixed width (column 5) is ignored and it is extended to fill up the grid area.  This is a bug IMHO.  The grid is ignoring my request to Fix the Width of columns.  The grid should extend the last column that is Sizable, not Fixed.

If I set up the grid to:

  • GridControl.DisplayLayout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.ResizeAllColumns

then ALL columns (including the Fixed Width columns) are resized as needed to fill the grid area.  This becomes very pronounced when the application is maximized and the grid area increases.  This is a bug IMHO.  Again the grid is not honoring my request to Fix column Widths.

**********

The only thing I can think of, and this is not optimal, is that I will set the grid to AutoFitStyle.None and resize the columns on a size event.  This is something the grid should be doing and not me.  Anyone have any ideas on how to get around this bug?  Can I "Lock" a column in place?