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
I can provide you a sample using the igHierarchicalGrid, it almost the same with only deference that your BillToContact will be displayed as child grid. But if you want to display each phone number in a separated column you will still should use formula function and unbound column. It is recommended to modify your data source in order to be flat. If you are unable to do this you can still use the approach with formula functions and unbound column.
Currently you cannot listen for events using entirely MVC wrapper functions you have to use JavaScript.
You can suggest this as a new product idea for future versions at <http://ideas.infragistics.com>.
Steps to create your idea:
1. Log into the Infragistics Product Ideas site at http://ideas.infragistics.com (creating a new login if needed). 2. Navigate to the product / platform channel of your choice (e.g. WPF, Windows Forms, ASP.NET, HTML5 / Ignite UI, iOS / NucliOS, etc.) 3. Add your product idea and be sure to be specific and provide as much detail as possible. Explain the context in which a feature would be used, why it is needed, why it can’t be accomplished today, and who would benefit from it. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. Be convincing!
The benefits of submitting the product idea yourself include:
- Direct communication with our product management team regarding your product idea. - Notifications whenever new information regarding your idea becomes available.
Additional benefits of the product idea system include: - Ability to vote on your favorite product ideas to let us know which ones are the most important to you. You will have ten votes for this and can change which ideas you are voting for at any time. - Allow you to shape the future of our products by requesting new controls and products altogether. - You and other developers can discuss existing product ideas with members of our Product Management team.
The product ideas site allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
Thanks for your reply would you have a example of the igHierarchicalGrid using MVC not javasrcipt. I then could get closer to what I am aiming for.
Hello Antony,
The following sample demonstrates create MVC igHierarchicalGrid using only mvc Wrappers.
http://www.igniteui.com/hierarchical-grid/aspnet-mvc-helper
I am following up to see if you need further assistance.