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
237
PerformAutoResize when using AllowColSizing.Synchronized.
posted

Hi,

I am using the AllowColSizing = AllowColSizing.Synchronized property in an UltraWinGrid to keep the columns of different bands in synch. This works nicely, when the user resizes the column in 1 band, the columns in other bands (on the same level) resize as well.

However, I want the columns to initially be autosized, so I execute a PerformAutoSize (tried all overloads) on every band. This works, except that synchronization is causing the resize on 1 band to affect the other. This is logical and also desired except if it makes the column smaller as this will clip the contents of the column in the other bands. Note that the behaviour is the same when you double click the divider on the column header, it causes the content in other bands to become clipped.

Is there a way to autosize these columns in such a way that the synchronization honours the band with the largest content?

  • 469350
    Offline posted

    Hi,

    Instead of calling PerformAutoResize on the column, call CalculateAutoResizeWidth, instead. This method returns the AutoSized width of the column without actually applying it. That way you can call this method on the each band for columns with the same index and then find the largest width and set the Width on the column yourself.