Hello, I am using ASP NET MVC 5 with IgniteUI 2016.2.
I have list of list my data return from database.
List<ClassData> MyClass;
class ClassData{
// other prop
List<Detail> Detail;
}
Class Detail{
//other prop}
I tried to send all data direct to View with GridModel. The value is my List of list I mentioned above and try to render it with ASP Razor Helper but no luck. Then I read example from IgniteUI for ASP, and it use Datatable to achieve hierarchical grid.
How can I make hierarchical grid without using datatable? I prefer to just send my data to View, and render all column setting in View with Razor.
Hello johnson,
Please refer to the attached sample in which igHierarchicalGrid uses GridModel and List data.
Sincerely,Yuki
Developer Support Engineer
Infragistics Inc.
www.infragistics.com/support
Is it possible to use multi column header in child table? I add this code:
................................GridColumnLayoutModel layout = new GridColumnLayoutModel();................................
List<GridColumn> A = new List<GridColumn>();A.Add(new GridColumn() { HeaderText = "A 1", Key = "A1" });A.Add(new GridColumn() { HeaderText = "A 2", Key = "A2" });
layout.Columns.Add(new GridColumn() { HeaderText = "AA", Group = A });
List<GridColumn> B = new List<GridColumn>();B.Add(new GridColumn() { HeaderText = "B 1", Key = "B1" });B.Add(new GridColumn() { HeaderText = "B 2", Key = "B2" });
layout.Columns.Add(new GridColumn() { HeaderText = "BB", Group = B });
grid.Features.Add(new GridMultiColumnHeaders()); grid.Features.Add(new GridSelection() { Mode = SelectionMode.Row });
result is no header show for child table. Is there something missing?
Would you check whether layout enables GridMultiColumnHeaders feature? I attach a new sample that enables multi column header for your reference.
Developer Support EngineerInfragistics Inc.www.infragistics.com/support
Works like a charm! Thank you.
Thank you for your feedback.
I am glad to know that I was able to help you achieve the functionality you were looking for. I believe this thread can help other people looking for a similar solution.
If you require any further assistance on this matter, please let me know.