I have a model with dynamic "properties" (at the database level, something similar to the Entity-Attribute-Value system ). The properties are in the Dictionary<int, string> field and would like to display them in columns.
Model:
the model has a static array (initialized in a static contextum) of the names of "properties" and keys:
public static ModelSpecialParameter[] SpecialFields;
and a dictionary (initialized in the create model, and all possible keys are added) with their values.
public Dictionary<int, string> ValuesForDynamicProps;
View :
@(Html.Kendo().Grid(Model) .Name("grid") .Columns(columns => {
I get an error message:
{"Linked columns require expressions to access a field or properties." }
I also tried:
columns.Bound(e => e.ValuesForDynamicProps[item.IdProperty]).Width(140).Title(item.DisplayName);
same mistake.
Even if what I want is impossible. I am looking for an idea how to get the desired result: Flexibility in adding and removing properties.
asp.net-mvc telerik-mvc
dovid
source share