We have a radgrid that gets bound in 2 different ways. This depends on what action has been performed on the page..e.g
1. select comboboxA - will bind radgrid via server side binding using NeedDataSource event
2. select comboboxB - will bind radgrid via page method + client side binding . Below are are the the main 2 javascript functions in use .
function GetDataForGrid() { PageMethods.GetDataForGrid(GetDataForGridBy_Result, GetDataForGridByHeader_Failed);}
function GetDataForGrid_Result(result) {
var tableView = $find("<%=RadGrid.ClientID %>").get_masterTableView();
tableView.set_dataSource(result.Value);
tableView.dataBind();
}
The problem is, after the client side binding, if the user clicks on a certain row we need to do some processing in a server side event - RadGrid_ItemCommand(object sender, GridCommandEventArgs e) ...
However when we obtain the datakey within this server side event, it is always wrong....