Set Grid column width

Posted by: kshitizkumar on 19 July 2019, 7:54 am EST

    • Post Options:
    • Link

    Posted 19 July 2019, 7:54 am EST

    Hi,

    I have a grid with 10 odd columns and I have set the column widths in the display column section of the TrueDB grid designer view. Now when I attach the grid with a data source (grid.datasource = datatable), all the column widths in the grid move back to some default value. I don’t know why it is happening even though I am setting the column widths in the designer. Does anyone have idea as to why it is happening and a way to prevent it.

    Thanks in advance!

    Regards,

    Kshitiz

  • Posted 23 July 2019, 10:11 am EST

    Hello,

    If you are setting the DataSource at run time, the grid won’t honor the design time layout.

    You need to use an overload of SetDataBinding method of TrueDBGrid (with holdFields argument set to true) to set the datasource at run time with preserved layout.

    If you are doing something else, please let me know or attach a stripped down sample replicating the issue.

    Thanks and Regards,

    Prabhat Sharma.

  • Posted 24 July 2019, 8:39 am EST

    Thanks Prabhat for the clarification. I will use the method suggested.

    Regards,

    Kshitiz

Need extra support?

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

Learn More

Forum Channels