I'm trying to get selected grid rows KeyField value on client side;
I used to try followings and get various results:
Method #1
<ClientSideEvents RowClick="function(s, e) {var key= grid.GetSelectedKeysOnPage()[0];}" />
//This gives previous selected rows value everytime
Method #2
<ClientSideEvents RowClick="function(s, e) { grid.GetRowValues(grid.GetFocusedRowIndex(), 'MyKeyFieldName', OnGetRowValues); }" />
//This gives previous selected row and also gives an error: "A primary key field specified via the KeyFieldName property is not found in the underlying data source. Make sure.. blabla" But the MyKeyFieldName is true and i dont want to make a callback, i dont want to use this method!
Method #3
<ClientSideEvents RowClick="function(s, e) { grid.GetRowValues(e.visibleIndex, 'MyKeyFieldName', OnGetRowValues); }">
//This gives the same result with Method #2
The question is: How can i gather KeyField Value of (not previous but) current selected row at client RowClick event without a callback or postback?