Posted 30 November 2017, 6:05 am EST
Hi,
Is it possible to bind the data source of a FlexGrid to a (dynamic) class which properties are defined during runtime?
Using the example from the MVCExplorer, I have tried the following but it does not seem to work:
@model IEnumerable<dynamic>
/* ... */
@(Html.C1().FlexGrid<dynamic>()
.Id("ovFlexGrid")
.AutoGenerateColumns(true)
.Bind(bl => bl.InitialItemsCount(100).Bind(Model).OnClientQueryData("collectingQueryData"))
.CssClass("grid")
.IsReadOnly(true)
.AutoClipboard(true)
.SelectionMode(SelectionMode.Row)
.AllowSorting(true)
.Filterable(f => f.DefaultFilterType(FilterType.Both).ColumnFilterTypes(filterTypes))
)
This is what I’m passing in through the controller,
new List<dynamic>(/*Some data*/);
Let me know if you me to attach more code, or elaborate on anything.
Thanks!
Victor