I am able to add new rows to my WHDG using JavaScript.
var childGrid = _getChildGridView();childGrid.get_rows().add(newRow);
In my example, if a Parent had 3 Child Rows (1 row was present, the other 2 were added on the client), I am able to see all of my rows on a PostBack including my 2 new rows. However, only one row has data while iterating the rows.
Protected Sub getContainerGrid(ByVal gridView As ContainerGrid) ' Iterate through rows For i As Integer = 0 To gridView.Rows.Count - 1 If gridView.Rows(i).Items.Count = 28 Then If gridView.Rows(i).Items(12).Value = "Y" Then gridView.Rows(i).CssClass = "someCssClassName" End If End If
' Recursively call the method for each row If gridView.Rows(i).HasRowIslands Then getContainerGrid(gridView.Rows(i).RowIslands(0)) End If Next End Sub
Here is the result...
gridView.Rows(0).Items(3).Value = "100.00" (last row added on client)
gridView.Rows(1).Items(3).Value = Nothing (second row added on client)
gridView.Rows(2).Items(3).Value = Nothing (present row on load)
Any help would be appreciated!
I have solved this issue. I added e.Band.DataKeyFields = "primaryKeyID" to the grid's _InitializeBand() event handler and it now works like a charm. It also solved a duplicating key error on the client side when you click into a cell of any new rows that were added via the client.