C1FlexGrid: Data binding with dynamic # of columns

Posted by: t_sch on 9 September 2017, 8:22 am EST

  • Posted 9 September 2017, 8:22 am EST

    Hi,
    is it possible to data bind to a data source with an at compile time unknown number of columns?
    My data source results from a pivot query so the number of columns depends on the data. I have a collection [rows] of collections [columns] of values and want to use pure MVVM without code-behind.
    I saw that the columns can be defined in XAML and I think that can be done in code, too. But I can't do that in a ViewModel as I have no reference to the grid.
    Can the Columns collection be bound, too? Didn't find a way.
    Thomas
  • Marked as Answer

    Replied 9 September 2017, 8:22 am EST

    Hello Thomas,

    You can bind the Columns of C1FlexGrid through code using the MVVM design pattern. For this, you need a reference of your C1FlexGrid into a ViewModel.
    Please find the attached sample implementing your scenario and let me know if I missed something.

    Hope it helps.

    Thanks,
    Prashant
    2015/04/WinRT_C1FlexGrid_ColumnBinding_MVVM.zip
  • Replied 8 November 2017, 4:22 am EST

    fff
Need extra support?

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

Learn More

Forum Channels