Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
105
Handle an array inside a list an infragistics ignite datagrid
posted

I am wondering if anyone could help with a problem I am having using the Infragistics ignite data grid. I am using the Infragistics.Web.Mvc .net library. The issue is that I have an array inside my list which is filling the grid. I want to be able to display each value in the array in a separate column. This works in my view for example.

@foreach (var item in Model) {
var firstname = item.BillToContact.FirstName;
var lastname = item.BillToContact.LastName;
foreach (var number in item.BillToContact.PhoneNumbers) {
@Html.DisplayFor(modelItem => firstname )
@Html.DisplayFor(modelItem => lastname )
@Html.DisplayFor(modelItem => number.Number)
}
}
However when I try to do this inside my datagrid in any shape of form the column remains empty. I was trying simple way to output into the grid approach in the snippet below.

.Columns(col =>
{
// problem is here
col.For(c => c.BillToContact.PhoneNumbers[0].Number).HeaderText("PhoneNumbers1").Width("200px");

col.For(c => c.ID).HeaderText("ID").Width("100px");
col.For(c => c.Name).HeaderText("Name").Width("200px");
col.For(c => c.BillToContact.Name).HeaderText("BillToContactName").Width("200px");
col.For(c => c.BillToContact.Title).HeaderText("Title").Width("200px");
})

Would anyone know how to display the contents of an array were each value is in a separte column which is inside a library which is the datasource for a Infragistics ignite data grid.?

Parents Reply Children
No Data