Hi,
I have a ajax enabled hierarchical grid (with server side sorting, client side filtering and paging). I am also subscribing to the OnActiveRowChange event.
I am trying to select a child row, which will set a session variable based on the row id. But every time I select a child row, the grid performs a post back (as expected) and on the return the grid collapses the parent row I expanded and thus my child row is not selected. Now, the grid does not collapse the parent row if I disable AJAX and my child row is selected. Is there any way to get this behaviour with AJAX enabled?Thanks.
I solved my issues by adding these 2 event handlers in the VB.Net code behind:
1) ActiveCellChange event
e.Cell.Row.Selected = True
e.Cell.Row.Activated()
2) SelectedRowsChange
e.SelectedRows.Items(0).Selected = True
If someone can explain why this is necessary, I would get a better understanding of the grid and Ajax.
- Thx
I have a similar problem using Webgrid 8.2 developed under Visual Studio 2005, VB.Net.
Issue 1
I have the WebGrid and Button1 on UpdatePanel1. Via the row selector column, I select a row ( the row highlights ). Button1 triggers VB.Net code behind function that uses the "rowA = grid.DisplayLayout.ActiveRow" and attempts to retrieve column 1 value. However, rowA is Nothing, the UpdatePanel1 WebGrid refreshes and the ActiveRow grid highlight disappears.
Issue 2
I have the WebGrid on UpdatePanel1. Via the row selector column, I select a row ( the row highlights ). I have 2nd UpdatePanel2 with a Button2 that runs a VB.Net code behind function. "rowA = grid.DisplayLayout.ActiveRow" and attempts to retrieve column 1 value. However, rowA is Nothing, the UpdatePanel1 WebGrid does not refresh and the ActiveRow is still highlighted. If I run UpdatePanel2 Button2 again, the ActiveRow is found and I can retrieve a value
If I change the ActiveRow and run UpdatePanel2 Button2, the ActiveRow is the previous row. I have to run UpdatePane2 Button2 a 2nd time to get the correct value.