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.?
Hello Anthony,
Thank you for contacting Infragistics Developer Support!
Your data source is hierarchical and the grid accepts only flat data source. You have two options:
1) To modify your data source in order to be flat
2) Use unbound columns and formula for displaying the content. I have attached a small project sample demonstrating the following, which you can find attached to the this reply.
I would strongly suggest the first approach, transforming your data source before passing it to the grid, because using formula and unbound columns could affect some grid features.
Please let me know if you need further assistance.
Can this be done using your igHierarchicalGrid if so would you have an example.
Or would you have an example of selecting for an example a customer from a grid and then being directed to a form using Infragistics.Web.Mvc as I can only seem to find javascript versions