c1FlexGrid: rows's height

Posted by: juan.ome on 25 January 2022, 5:51 pm EST

    • Post Options:
    • Link

    Posted 25 January 2022, 5:51 pm EST

    We are migrating from vb6 to vb.net. The rows’s height propertie in the FlexGrid, on vb6, has a default value of 16 pixeles, but in vb.net this value is 19 pixels, then the effect in the grid is the quantity of rows that I can see… while in vb6 I can see 10 rows, in vb.net I can see only 7 because the rows is bigger than vb6. In the other hand, when we change the control’s Font, the height grows and the effect turn worst.

    We found the way to change this height(heightdisplay) in order to be almost like vb6, it is possible row by row, but it compromise the performance.

    The question is: How can we change the rows’s height to be almost like vb6, without going through rows?

    A example is attached.

  • Posted 25 January 2022, 5:57 pm EST

    The example…

    PruebaFlexGrid.zip

  • Posted 26 January 2022, 5:27 am EST

    Hi Juan,

    you could give “c1FlexGrid.Rows.DefaultSize” a try - this sets the height for all rows.

    I am not sure whether you have to set it before adding rows to the grid, or whether it will also have an effect if set afterwards.

    Best regards

    Wolfgang

    PS: if you post samples, please post the source code. I don’t execute a EXE file in a zip :wink:

  • Posted 27 January 2022, 12:32 am EST

    Hi,

    You can use the C1FlexGrid.Rows.DefaultSize and C1FlexGrid.Cols.DefaultSize properties to set the default row height and column width of the flex grid. By default, these properties are set to -1 and hence calculated according to the Font Size of the grid.

    Once you explicitly set the default size of the rows and columns, the size will not change according to the font of the flex grid.

    Example:
    C1FlexGrid1.Rows.DefaultSize = 30
    C1FlexGrid1.Cols.DefaultSize = 60
    
    

    Regards

    Avnish

    PS: Thank you for the help, Wolfgang. Setting the property takes effect for both, before adding the rows as well as afterward as long as the row height is set to -1.

Need extra support?

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

Learn More

Forum Channels