We are using the WHDG from version 13.2. Below get called on initialization of each row.
Private Sub dgGrid_InitializeRow(ByVal sender As Object, ByVal e As RowEventArgs) Handles dgGrid.InitializeRow
…..
End Sub
On InitilizeRow event we do get each row. We do alter each column from the row to assign hyperlinks & assign javascript to it.
How to identify the band for current row?
Thanks!
Hello Parikshit,
Thank you for contacting us.
You can get the Rows collection and from there to get the specific row and access its RowIslands collection. You can use the Row Index in order to get the desired row.
protected void WebHierarchicalDataGrid1_InitializeRow(object sender, Infragistics.Web.UI.GridControls.RowEventArgs e) { //(sender as WebHierarchicalDataGrid).GridView.Rows[e.Row.Index].RowIslands[0] }
Other ways how to access the child bands can be found into the attached sample:
protected void Page_Load(object sender, EventArgs e) { if (Session["Data"] == null) { Session["Data"] = populateGrid(); this.WebHierarchicalDataGrid1.InitialDataBindDepth = 1; this.WebHierarchicalDataGrid1.DataSource = Session["Data"]; this.WebHierarchicalDataGrid1.DataBind(); int firstRowIslandsCount = this.WebHierarchicalDataGrid1.GridView.Rows[0].RowIslands.Count; int childRowCount = this.WebHierarchicalDataGrid1.GridView.Rows[0].RowIslands[0].Rows.Count; resultLbl.Text += firstRowIslandsCount + " and have " + childRowCount + " child rows"; } else { this.WebHierarchicalDataGrid1.DataSource = (DataSet)Session["Data"]; } } protected void WebHierarchicalDataGrid1_RowIslandsPopulated(object sender, Infragistics.Web.UI.GridControls.ContainerRowEventArgs e) { //get the first row items collection Session["FirstChildRowItems"] = e.Row.RowIslands[0].Rows[0].Items; }
Let me know if I may be of further assistance.
Thanks for Replay!
I am confused. We are more focused on below event as each hyperlink has to have Band_row_columnID to identify each link.
protected void WebHierarchicalDataGrid1_InitializeRow(object sender, Infragistics.Web.UI.GridControls.RowEventArgs e){
//if there are three bands & each bands has 4 rows & each row has one link.
How to identify each link present in row?
Gridid_BandIndex_RowIndex
}
Please Confirm.
Looking forward to your reply.
Hello,
As I understand you want to access the Child Grid Rows, although on InitializeRow this wont be possible, because the Child Grids (which are in the Parent row RowIslands) are not yet populated. My suggestion is to handle RowIslandsPopulated and there to access the child grid rows and get each hyperlink.