[Serializable]
public class ContactDto
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string CompanyName { get; set; }
public Dictionary<string, string> CustomFields { get; set; }
}
I have the contactdto class above with a dictionary of customfields. Those can be anything 'MotherName' 'Birthdate' etc.
How do i display the custom fields as columns in the kendo grid? All the contactDTO's will have the same dictionary keys. I am using the ASP.net MVC helpers.
I have tried something like - which does not work -
@(Html.Kendo().Grid<ContactDto>(Model)
.Name("ReportViewer-Data")
.Columns(columns =>
{
columns.Bound("FirstName");
columns.Bound("LastName");
columns.Bound("CustomFields.Industry");
})
.Sortable()
.Pageable(pageable => pageable.PageSizes(true).ButtonCount(5))
.Groupable()
.Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple))
.Resizable(resize => resize.Columns(true))
.Reorderable(reorder => reorder.Columns(true))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("DataView_Test", "Reports"))
)
)