What is the intended use of AutoHeightCaption method in TrueDBGrid

Posted by: mtashildar on 9 August 2019, 5:45 am EST

    • Post Options:
    • Link

    Posted 9 August 2019, 5:45 am EST

    TrueDBGrid for WinForms 2019v1

    Improvements

    Added the AutoHeightCaption method. This method calculates the height of display columns caption by caption string.

    The above text is from the Release History.

    Please explain the intended use of AutoHeightCaption method.

    In what scenario we can make use of it and how?

    Regards

    Mahesh

  • Posted 9 August 2019, 7:35 am EST

    Hello,

    AutoHeightCaption method is use to control the height of Column Headers depending on the caption of the column.

    It is dependent on the wrap property of HeadingStyle and ColumnSelectorStyle objects of TrueDbGrid.

    Code snippet is given below :

    c1TrueDBGrid1.HeadingStyle.Wrap = TextWrapping.Wrap;
    c1TrueDBGrid1.ColumnSelectorStyle.Wrap = TextWrapping.Wrap;
    c1TrueDBGrid1.Splits[0].AutoHeightCaption();
    

    Please refer to the attached sample demonstrating the same.

    Thanks and Regards,

    Prabhat Sharma.

    Prj_ColHeaderWrap.zip

  • Posted 1 August 2021, 7:09 am EST

    Hi,

    c1TrueDBGrid1.Splits[0].AutoHeightCaption()

    As per the documentation, This method calculates the height of display columns caption by caption string.

    But I have following questions about the AutoHeightCaption method (after seeing sample demo):

    1. Does it mean that it sets the height of display columns caption automatically?

    2. Will it work, if I reduce the caption string length programmatically after the grid initialization?

    The whole purpose should be optimum utilization of column headers space in terms of dynamic grids captions.

    How I expect it to work is:

    If I reduce column’s width then caption string should be wrapped and header height should be increased

    and

    if I expand column’s width then caption string should be un-wrapped and header height should be reduced (provided other column’s caption allow so) accordingly.

    Regards

    Mahesh

  • Posted 2 August 2021, 4:49 am EST

    Hello Mahesh,

    We also observe some issues with the AutoHeightCaption method so discussing the same with the developers and will let you know the updates soon.

    [Internal Tracking Id: C1WIN-25404]

    Regards,

    Prabhat Sharma.

  • Posted 26 April 2023, 12:22 am EST

    Hello Mahesh,

    Apologies for the delay in response.

    This issue has been fixed back in 2021v2 builds.

    Regards,

    Prabhat Sharma.

Need extra support?

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

Learn More

Forum Channels