AddHandler Me.WebHierarchicalDataGrid1.RowIslandDataBinding, AddressOf WebHierarchicalDataGrid1_RowIslandDataBinding Protected Sub WebHierarchicalDataGrid1_RowIslandDataBinding(ByVal sender As Object, ByVal e As RowIslandEventArgs) Handles WebHierarchicalDataGrid1.RowIslandDataBinding ' parent band If e.RowIsland.DataMember = "SqlDataSource1_DefaultView" Then If Not IsPostBack Then Dim field1 As New TemplateDataField() field1.Key = "TemplateColumn1" field1.Header.Text = "Edit" Me.WebHierarchicalDataGrid1.Columns.Add(field1) 'get reference to the template column Dim templateColumn1 As TemplateDataField = DirectCast(Me.WebHierarchicalDataGrid1.Columns("TemplateColumn1"), TemplateDataField) templateColumn1.ItemTemplate = New CustomItemTemplate() End If End If ' Child Level If e.RowIsland.DataMember = "SqlDataSource2_DefaultView" AndAlso e.RowIsland.ParentRow = Me.WebHierarchicalDataGrid1.GridView.Rows(0) Then Dim field2 As New TemplateDataField() field2.Key = "ChildTemplateColumn1" field2.Header.Text = "Edit" Me.WebHierarchicalDataGrid1.Bands(0).Columns.Add(field2) Dim templateColumn2 As TemplateDataField = DirectCast(Me.WebHierarchicalDataGrid1.Bands(0).Columns("ChildTemplateColumn1"), TemplateDataField) templateColumn2.ItemTemplate = New CustomChildItemTemplate() End If End Sub