Hello. In the ultraweb grid when you are ready too add a new line you simply just go to another existent row in the grid and the new row get's added inmediatly. a was asked by my manager to get the same behavor (a neww line created) when you press the enter key. I'm not very sure about how to do it.
Thanks in advance
many thanks for your answer. I have a grid with some dropdown list and some rules coded on client js. The grid is in the mode where you have a different color empty row below with some default values. The ddl's on the virtual new row work. if I go and fill some cells and then go to a different row in the grid, the row get's added becoming part of the "white rows", What i was asked to do if to reproduce the same behavior when we while located in the new row press enter. No much luck so far.... here an example of what i was trying.
function UltraWebGrid1_EditKeyDownHandler(gridName, cellId, key){ //if the key is different than enter i'll exit if (key != 13) return; //If the cellId is not in the format gridnamer_somenumber i'm not in // the new empty row, so i'll exit the function var parts = cellId.split("_"); if (parts.length!=2) return // up until here it works what should i do next? // I want the current row to became a "normal" row, and // a new row with a different color should appear in the // exact way it happens if i hit the arrow up.... // i've tried two things so far //igtbl_addNew(gridName,0,true,true); // the above will add a new not inizialized row //(there are many defaults values missing) below and // everything will freeze up // i also tried to emulate the arrow up behavior by doing //var nRows=grid.Rows.length-1; //oldCell=grid.Rows.getRow(nRows).getCell(1); //grid.setActiveCell(oldCell); // it actually works but the focus is in the wrong row, and the // other scripts and ddl don't work, the values get updated in the
//wrong places.
it is nothing like newrow.addtogrid or grid.rows.add(currentrow) ??
thank you
You would probably be able to do this on the EditKey Client Handlers or in the regular Grid Key handlers on the client. If you provide me with some further details on exactly at which point the user presses the enter key etc i could provide some more guidance.