Okay,
I have a grid with BatchEdit = row, AllowKeyboardNavigatoin=true and I have written some javascript to allow ctrl arrowup and ctrl arrowdown to move to the previous row or next row. When moving to the previous or next row, the row is opened for Row Edit.
The row is opened but focus is set to the first editable column. How can I set focus to the cell (column) where the cursor was previously located?
I would like to be able to scroll update and down the rows and stay in the same column.
<js>
function arrowKeypress(e) {
var grid = $find("<%=RadGrid1.ClientID%>");
var row = grid.get_batchEditingManager().get_currentlyEditedRow();
selectedColumn = e.currentTarget.cellIndex;
if (e.keyCode == 38 && e.ctrlKey) {
// Arrow Up
var row = grid.get_batchEditingManager().get_currentlyEditedRow();
if (row.previousSibling) {
grid.get_batchEditingManager().openRowForEdit(row.previousSibling, selectedColumn);
}
}
else if (e.keyCode == 40 && e.ctrlKey) {
//Arrow Down
if (row.nextSibling) {
grid.get_batchEditingManager().openRowForEdit(row.nextSibling);
}
}
return true;
}
</js>
Thank you.
I have a grid with BatchEdit = row, AllowKeyboardNavigatoin=true and I have written some javascript to allow ctrl arrowup and ctrl arrowdown to move to the previous row or next row. When moving to the previous or next row, the row is opened for Row Edit.
The row is opened but focus is set to the first editable column. How can I set focus to the cell (column) where the cursor was previously located?
I would like to be able to scroll update and down the rows and stay in the same column.
<js>
function arrowKeypress(e) {
var grid = $find("<%=RadGrid1.ClientID%>");
var row = grid.get_batchEditingManager().get_currentlyEditedRow();
selectedColumn = e.currentTarget.cellIndex;
if (e.keyCode == 38 && e.ctrlKey) {
// Arrow Up
var row = grid.get_batchEditingManager().get_currentlyEditedRow();
if (row.previousSibling) {
grid.get_batchEditingManager().openRowForEdit(row.previousSibling, selectedColumn);
}
}
else if (e.keyCode == 40 && e.ctrlKey) {
//Arrow Down
if (row.nextSibling) {
grid.get_batchEditingManager().openRowForEdit(row.nextSibling);
}
}
return true;
}
</js>
Thank you.