Hi all,
I'm having troubles setting focus to the next cell in my grid. Here is my situation:I have a UltraWegGrid that contains studentnames and multiple columns for grades they score on tests. If a user enters a score , the cell below the one just used should become active. This should happen after a TAB, ENTER of maybe even a keydown keypress.I have found this example:http://forums.infragistics.com/forums/p/12988/48099.aspx#48099Wich pointed me to the AfterExitModeHandler. (see code below). This one works, but only when TAB is pressed!! If i hit enter the cell below will become SELECTED, but not Editable?!how can i make the Enterkey or the keydown key respont to this piece of code?Can i fire this event from the KeyDownEvenHandler? (can events be nested, or how should i call that?)
I look forward hearing from you
CheersEelkocode from link:function AfterExitEditMode(gridID, cellID) { var grid = igtbl_getGridById(gridID); var cell = igtbl_getCellById(cellID); var cellIndex = cell.Index; var rowIndex = cell.Row.getIndex();
if (cellIndex > 0) cellIndex--; var newCellID = gridID + "_rc_" + (rowIndex + 1) + "_" + cellIndex; var newCell = igtbl_getCellById(newCellID); if (newCell != null){ newCell.activate(); } }
In addition to the afterexitmode handler, you need the keydown handler. here is the java code that I use.
Regards,
Willie
function
OnUwgKeyDown(gn, cellId, KeyStroke) {
// Tab Key
(KeyStroke == 9) {
SelectNextCell(gn);
;
}
(KeyStroke == 13) {
Oke,. i understand i need to user the OnKeyDown event, thanx!What code is in your SetNextCell() fuction?