Reputation: 7208
In my RadGrid (early 2014 version) I have this:
<ClientSettings>
<ClientEvents OnBatchEditOpening="batchEdit" />
</ClientSettings>
Then I have this js function:
function batchEditInitialInvestments(sender, args) {
...
}
This is working great mostly, I can grab (inside the js) the column uniquename that was clicked and other useful properties. I can also get the total number of rows in the grid. What I just can't find is which row was clicked (edited in batch mode), by index. For example, say there are 3 rows in my radgrid and the middle/2nd row is clicked/edited. How can I discover that "index 1" was clicked?
I have scoured the API docs at the following locations:
http://www.telerik.com/help/aspnet-ajax/grid-getting-familiar-with-client-side-api.html http://www.telerik.com/help/aspnet-ajax/grid-onbatcheditopening.html
Upvotes: 0
Views: 1814
Reputation: 64
You can retrieve the cell of the selected row from the master table view as shown below.
function batchEditInitialInvestments(sender, args) {
var grid = $find('<%=RadGridName.ClientID%>');//can also use the sender parameter
var master = grid.get_masterTableView();
var selected = master.get_selectedItems();
var row = selected[0];
var cell = master.getCellByColumnUniqueName(row, "ColumnUniqueName");
//cell is the cell of the selected row
}
Upvotes: 1