Hi,
I can do manual on demand for second level by implementing RowIslandsPopulating event of grid and in RowIslandsPopulating method I am adding ContainerGrid for child grid.
Now I need to implement RowIslandsPopulating event for child ContainerGrid also but it looks like ContainerGrid is not support RowIslandsPopulating event.
Please let me know how to achieve this functionality with using hierarchy data source or any other data source. On demand data is coming from database so no fixed structure (column) for child grid.
Thanks.
Thank you very much. 1 more question, on my lowest band, 3rd level. How do I hide the expansion column?
Thank you!!
Hello Rich,
In order to determine the depth you can use Level property of the Row object.
Code snippet:
protected void WebHierarchicalDataGrid1_RowIslandsPopulating(object sender, ContainerRowCancelEventArgs e){ int level = ((Infragistics.Web.UI.GridControls.ContainerGridRecord)(e.Row)).Level;
if (level == 0) { // Parent record
} else { // Child records
}}
This has worked for me but now how do I populate The 3rd level in the RowsIslandsPopulating method? Is there a way to tell which level I am trying to exapand?
Thank you.
Hi omidixit,
It has been some time since your post, however in case you still need assistance I would be glad to help.
In this scenario you need to make the rows of the child container grid expandable so as for the RowIslandsPopulating method to be fired upon childgrid row expansion. This can be achieved by looping through the child container grid's rows (after it is data bound) and setting the IsEmptyParent property to true. For instance:
ContainerGrid child = new ContainerGrid(); e.Row.RowIslands.Add(child); child.DataSourceID = SqlDataSource2.ID; child.DataBind(); for (int i = 0; i < child.Rows.Count; i++) { //make the rows in the child grid expandable child.Rows[i].IsEmptyParent = true; }
Please feel free to contact me if you have any questions.
Best Regards,
Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://ko.infragistics.com/support