C1FlexGrid Row Height Not Resizing

Posted by: jallen on 4 August 2023, 11:05 am EST

    • Post Options:
    • Link

    Posted 4 August 2023, 11:05 am EST

    We use our own class that inherits from C1FlexGrid extensively in our Windows forms, as well as the Softgroup .Net Forms Resize control to automatically resize form contents when the user resizes the form. The Softgroup control handles the ClientSizeChanged event on the forms to resize the C1FlexGrid by setting its Height, Width, and Font size.

    In the latest build, if the C1FlexGrid.Rows.DefaultHeight is set to any value other than -1, then increasing the Height of the grid will not increase the row height. The row height remains static while the font size increases, causing the text in the rows to be truncated.

    In the old build we were using, you could set the FlexGrid.Rows.DefaultHeight to any value and the grid rows would increase in height after increasing the Height of the grid.

    Is there any way to get the old behavior back? Otherwise, we will need to go with the DefaultHeight of -1 which does not display with the row height we want.

    Please see the attached sample.

    John

    FlexGridResizeTest.zip

  • Posted 7 August 2023, 3:33 am EST

    Hi,

    This is the designed and correct behavior of the C1FlexGrid. The rows only get resized with the Font when C1FlexGrid.Rows.DefaultHeight = -1. We checked with the older builds (till 2019v3) and the behavior is the same. Could you please let us know which version you were using before the upgrade, so we can see when was this behavior changed?

    To workaround this behavior, you can set the DefaultHeight to a custom value on the startup and then set it back to -1 just when the form is resized, so that the grid starts following the Font for resizing the Rows. Please refer to the updated project for reference.

    FlexGridResizeTest_Updated.zip

    Best Regards,

    Kartik

  • Posted 8 August 2023, 11:17 am EST

    Thank you Kartik, the build we were using was 4.0.20161.147

    John

  • Posted 9 August 2023, 2:20 am EST

    Hi John,

    We checked with version 4.0.20161.147 and the behavior was indeed changed in the latest .NET FW 4.5.2 / 4.8 C1 controls. You will need to use the workaround from our previous response.

    Best Regards,

    Kartik

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels