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
385
CalculateAutoResizeWidth considers EditMode in UltraGridColumn
posted

Hi,

I have an issue with resizing the columns of a grid. When I calculate the column width twice, the column widths are actually different for the same grid content:

Calculation 1: In OnInitializeLayout in the UltraGrid

Calculation 2: In the OnSizeChanged in the UltraGrid

Only by coincidence, I have found an indication where the problem might be.  The difference seems to be that in the OnInitializeLayout, the value for the width seems to be same as if the widest cell content is in edit mode, while in the OnSizeChanged event the width is calculated as if the widest cell was not in the edit mode.

=> I think it would be more natural for a column width to be independent on the edit mode. Could you provide a workarond, change that or provide an option to enable/disable that?

Regards,
Reto

  • 469350
    Suggested Answer
    Offline posted

    Hi Reto,

    I'm not sure I understand what you mean. I am pretty sure that the calculations have nothing to do with whether or not a cell is in edit mode. But even if it did, why would that make a difference to the width of the cell? What leads you to believe that edit mode has anything to do with the difference?

    My guess would be that you are changing something in the grid either within InitializeLayout after you already called PerformAutoResize, or else in some other event that is firing in between.