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
665
Capture size of column on resize with AutoFitStyle.ResizeAllColumns
posted

I have a WinForms UltraGrid bound to a data source. Above the grid I have some controls which I want to align with specific columns underneath.

When a column's width is resized I want the controls above to resize too.

Initially I achieved this using the PropertyChanged event:

  if (e.ChangeInfo.FindPropId(Infragistics.Win.UltraWinGrid.PropertyIds.Width) != null)
  {
      if (e.ChangeInfo.FindPropId(Infragistics.Win.UltraWinGrid.PropertyIds.Header) != null)
      {
             // REPOSITION CONTROLS USING WIDTHS OR VISIBLE COLUMNS TO CALCULATE LOCATION
      }
  }

However once I set the grid AutoFitStyle to ResizeAllColumns the controls will not align correctly anymore.

e.Layout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.ResizeAllColumns;

Is there a more appropriate event to handle for this behaviour or someway of making it work when the AutoFitStyle is set to ResizeAllColumns?