in my controller i have the code describing the model..
for a simple header i do this:
grid.Columns = new List<GridColumn>(); grid.Columns.Add(new GridColumn("IDEmpresa", "IDEmpresa", "number", "0px")); grid.Columns.Add(new GridColumn("Nome da Empresa", "NomeEmpresa", "string", "200px")); grid.Columns.Add(new GridColumn("Nif", "Nif", "string", "100px")); grid.Columns.Add(new GridColumn("Tipo", "Tipo", "string", "100px")); grid.Columns.Add(new GridColumn("Criada por:", "CriadaPeloIDU", "string", "100px")); grid.Columns.Add(new GridColumn("Da Empresa:", "CriadaPeloIDUDaEmpresa", "string", "100px"));
how can i do it in hierarchical grid?
i have been trying to find information/code about this...
can you tell me if this is possible,,,,
how can i do that...
i will just give up on this problem...
is it possible to have a hierarchicalgrid with load on demand and multicolumn header?
there are some pages from infragistics that are displayed in the google search info about group and gridmulticoulmnheader that give error...
Hi Hugo,
Thank you for posting in our forums! Yes, it is possible to have Multi-column headers in Hierarchical Grid on every level no matter if you have load on demand or not. What you have to do is to create a GridColumn object and add the data column definitions in its Group collection. Then you add this object to the Columns collection of the layout model object. Also you need to add the MultiColumnHeaders feature to the grid’s definition in order this to work. You can review the code snippets below:
GridColumnLayoutModel layout = new GridColumnLayoutModel(); layout.Columns = new List<GridColumn>(); GridColumn group = new GridColumn(); group.HeaderText = "child group"; group.Group = new List<GridColumn>(); layout.Columns.Add(new GridColumn("Developer Id", "DeveloperId", "number", "100px")); group.Group.Add(new GridColumn("Project Id", "ProjectId", "number", "100px")); group.Group.Add(new GridColumn("Name", "Name", "string", "150px")); layout.Columns.Add(group); layout.Columns.Add(new GridColumn("Position", "Position", "string", "100px")); layout.Columns.Add(new GridColumn("Hire Date", "HireDate", "date", "120px")); layout.Columns.Add(new GridColumn("Salary", "Salary", "number", "120px"));
GridModel gridModel = new GridModel(); gridModel.Columns = new List<GridColumn>(); GridColumn group = new GridColumn(); group.HeaderText = "group"; group.Group = new List<GridColumn>(); group.Group.Add(new GridColumn("Project Id", "ProjectId", "number", "100px")); group.Group.Add(new GridColumn("Name", "Name", "string", "200px")); gridModel.Columns.Add(group); gridModel.Columns.Add(new GridColumn("Start Date", "StartDate", "date", "160px")); gridModel.Columns.Add(new GridColumn("End Date", "EndDate", "date", "160px")); gridModel.Columns.Add(new GridColumn("Is Postponed", "IsPostponed", "bool", "110px")); // add the MultiColumnHeaders feature gridModel.Features.Add(new GridMultiColumnHeaders() { Inherit = true });
The result of this code will look like the one in the attached screenshot. Also you can find more information about configuring multi-column headers here.
I hope this helps!
Kind regards, Petko Zhekov Senior Software Engineer
Hi Petko Zhekov,
I used it in the 2014.1, referring your example it worked for me.
Thank you.