This question is locked. New answers and comments are not allowed.
I want do to something like this:
However this is not possible, because it is necessary to have an accessor in the cols.Bound(). This implies, that it is always necessary to have a fully typed model. This is of disadvantage in many scenarios. For example to do a table with turnover and balance as rows and varying mixed time periods (weeks, months, quarters, years) as colums, that are calculated at runtime.
So what I need is generic columns.
Html.Telerik().Grid<TableRowPattern>() |
.Name(Model.name) |
.BindTo(Model.rows) |
.DataBinding(binding=>binding.Server().Select<APatternController>(c=>c.Detail(string.Empty))) |
.DataKeys(keys=>keys.Add(row=>row.RowKey)) |
.Columns( cols => { |
cols.Command(commands => |
{ |
commands.Select(); |
}); |
foreach (var col in Model.headings) |
{ |
cols.Bound<string>(row=>row.cells[Model.headings.IndexOf(col)]).Title(col); |
} |
}) |
.Pageable() |
.Sortable() |
.Filterable() |
However this is not possible, because it is necessary to have an accessor in the cols.Bound(). This implies, that it is always necessary to have a fully typed model. This is of disadvantage in many scenarios. For example to do a table with turnover and balance as rows and varying mixed time periods (weeks, months, quarters, years) as colums, that are calculated at runtime.
So what I need is generic columns.