Flex Grid Designer Removing Styles after Setting DataSource

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

  • 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.

Need extra support?

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

Learn More

Forum Channels