Dynamically build flexgrid in ASP.net MVC

Posted by: elogsdon on 4 June 2020, 5:05 am EST

  • Posted 4 June 2020, 5:05 am EST

    I am writing an ASP.Net MVC application. One of the requirements I have is to show information in a FlexGrid from a database. Each client can configure the columns shown in the grid. Client 1 may show columns A, B, and C while Client 2 may show columns D, E, F, and C.

    How can I build the columns collection at run time? In my WPF version of this application I can build a columns collection after the FlexGrid is loaded and set the collection in the FlexGrid. Is there a sample that might guide me?

    I am using server-side controls to make it easier to reuse code from my desktop application.

    Thanks,
    Eric.
  • Marked as Answer

    Replied 4 June 2020, 3:04 pm EST

    Hi Eric,
    You may use the FlexGrid columnLayout property to save the layout for each user and show the order of the columns according to the users.
    Please refer to the following sample for reference:
    https://demos.componentone.com/ASPNET/LearnMvcClient/C1FlexGrid/ColumnsColumnLayout

    Hope it helps!

    Regards,
    Manish Gupta
  • Replied 4 June 2020, 11:56 pm EST

    Thanks, Manish. I'll work with this and see how it goes.
Need extra support?

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

Learn More

Forum Channels