C1FlexGrid: Data binding with dynamic # of columns

Posted by: t_sch on 8 September 2017, 11:22 pm EST

    • Post Options:
    • Link

    Posted 8 September 2017, 11:22 pm 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

  • Posted 8 September 2017, 11:22 pm 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

  • Posted 7 November 2017, 7:22 pm EST

    fff

Need extra support?

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

Learn More

Forum Channels