When the grid is in edit mode, I cannot get the Excel like editing to work. This works fine in read-only mode, as in your demo sample.
Once a cell has focus, it stays in there until I hit enter. Then I have to hit Enter again to move down.
I there a simple way around this behavior?
don
Hello davery921,
Thank you for posting in our forum.
You can set the edit mode action that triggers entering of edit mode to be on key press. You can do this from the CellEditing Behavior for example:
<ig:CellEditing>
<EditModeActions EnableOnKeyPress="True" />
</ig:CellEditing>
This will enter edit mode of the current active cell when you press a key and will directly enter the value in the cell. You can exit edit mode when you change the active cell in any way (tab or click on another cell). Other such properties that affect the action that triggers entering edit mode are: EnableF2, EnableOnActive, MouseClick.
Let me know if you have any further questions or concerns regarding this.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
This is not what I would call Excel-like editing. Try entering a column of numbers on the keypad - at every entry you have to hit Enter to end editing mode, the Enter to go to the next cell. It is this double Enter key after every entry that makes columnar data entry very frustrating to the users.
You have a very good sample sheet available online that can be used to demonstrate the various EditModeActions, but none of them would I consider "Excel-like editing".
Hello davery921 ,
Thank you for the clarification. Here’s a possible solution for this.
1)Set EnableOnKeyPress="True".
2)Handle exited edit mode client side event.
3) For Exited edit mode check whether it was caused by hitting the Enter key. If so set the active cell to be the one on the next row. For example:
function WebDataGrid1_CellEditing_ExitedEditMode(sender, eventArgs) {
///<param name="sender" type="Infragistics.Web.UI.WebDataGrid"></param>
///<param name="eventArgs" type="Infragistics.Web.UI.EditModeEventArgs"></param>
if (eventArgs.get_browserEvent().type == "keydown" && eventArgs.get_browserEvent().keyCode == 13) {
var activeCell = sender.get_behaviors().get_activation().get_activeCellResolved();
var cellIndex = activeCell.get_index();
var rowInx = activeCell.get_row().get_index();
var nextRow = sender.get_rows().get_row(rowInx + 1);
var nextCell = nextRow.get_cell(cellIndex);
sender.get_behaviors().get_activation().set_activeCell(nextCell, false);
}
In this way when you hit enter you will both exit edit mode and change the active cell. You will go to the lower cell and you can directly start typing.
Please refer to the attached sample and let me know if you have any questions or concerns.
Hi,
I have tried your solution, and followed your instructions. When I run the test project, there was a javascript error as below :
"
Microsoft JScript runtime error: Unable to get value of the property 'get_activeCellResolved': object is null or undefined
Actually, I also tried a couple of other javascript events such as "EditorControl-ClientEvents-KeyPress", and found out that the grid.get_behaviors().get_activation() object always NULL. Anyway, I was able to get grid.get_behaviors() object which is not NULL. Please help!
Same request and same problem as the above post ( grid.get_behaviors().get_activation() object always NULL )
I try to move with TAB Key (KeyCode = 9) on the add row of WebDataGrid (v12.2) but it fail because the error above.
Any other solution?
my mistake... I enable the Edit Behaviors->Activation and all work fine.
Thanks