Flex Grid Designer Removing Styles after Setting DataSource

Posted by: tyree.jackson on 23 July 2024, 5:32 pm EST

    • Post Options:
    • Link

    Posted 23 July 2024, 5:32 pm EST

    Hello, I’m having trouble Keeping the Flex Grid Column Styles after setting the Datasource.

    In my designer I have 14 visible columns that I renamed and styled, but 22 in total. My sql store procedure returns a table with 22 columns. When I set FlexGrid.Datasource = Datatable my Flexgrid will unhide 8 columns and return the column styles to default.

    How can I prevent this from happening?

  • Posted 24 July 2024, 7:44 am EST

    Hello,

    You can use BuildString() and ParseString() methods to implement your use case as follows:

    var layout = c1FlexGrid1.Cols.BuildString(true);
    SetDatasource();
    c1FlexGrid1.Cols.ParseString(c1FlexGrid1, layout);

    However, while implementing this, we observed that an extra column was being added in the last. We have shared our observations with developers for further insights. Rest assured, we’ll update you once we have any information.

    [Internal Tracking ID: C1WIN-32711]

    In the meantime, you can remove the last column after restoring the layout.

    Please refer to the attached sample for implementation. (see FlexGrid_PreserveLayout.zip)

    Regards,

    Uttkarsh.

  • Posted 28 June 2025, 12:47 pm EST

    Hello,

    The issue has been resolved in the latest 2025v1 version of C1FlexGrid.

    Please upgrade the version of C1 to resolve the issue.

    You can download the latest version of ComponentOneControlPanel from https://developer.mescius.com/componentone/download.

    Regards,

    Uttkarsh.

Need extra support?

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

Learn More

Forum Channels