Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
UltraWebGrid, set focus to cell after edit problem/question.
posted

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#48099
Wich 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

Cheers
Eelko


code 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(); 
    }   
}

 

Parents
  • 175
    posted

    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

     

     

    if

    (KeyStroke == 9) {

    SelectNextCell(gn);

     

     

    return true

    ;

    }

     

     

    if

    (KeyStroke == 13) {

    SelectNextCell(gn);

     

     

    return true

    ;

Reply Children