When I hit the back button in my browser and return to a page that has a RadGrid with selected items I am getting 0 for the length of get_selectedItems(). The following code is wired to the RadGrid's OnGridCreated ClientEvent. I can see in the browser that when I return to the page my previously selected items in the RadGrid return to their selected state.
The necessary code is found below. Is there a better ClientEvent to subscribe to that will catch the RadGrid after it's selected items have been repopulated? The code snippet below is also wired to the RowSelected and RowDeselected ClientEvents and it functions properly. It is just a problem of running this code when my grid items selected state has been established after hitting the back button in my browser.
The necessary code is found below. Is there a better ClientEvent to subscribe to that will catch the RadGrid after it's selected items have been repopulated? The code snippet below is also wired to the RowSelected and RowDeselected ClientEvents and it functions properly. It is just a problem of running this code when my grid items selected state has been established after hitting the back button in my browser.
var grid = $find('<%= gvNodes.ClientID %>');
var gridSelectedItems = grid.get_selectedItems();
if (gridSelectedItems.length == 1) {
// enable a rad tool bar button
} else {
// disable a rad tool bar button
}