I need to add a child row from the parent, and when its added it should automatically enter into edit mode, so that the user can enter the information and save.
All I have now is that it adds a new child row, but I can't get it to enter the edit mode automatically
Thank YOu
Function AddDetail
{
var grid = ig_controls["WebHierarchicalDataGrid1"].get_gridView();
var gridrow = grid.get_behaviors().get_activation().get_activeCell().get_row();
gridrow.get_grid().get_rows().get_row(gridrow._index).set_expanded(true);
var rowislands = gridrow.get_rowIslands();
var childGrid = rowislands[0];
if (childGrid != null) {
var CodeNum = gridrow.get_cell(1).get_value();
var row = new Array(CodeNum);
gridrow.get_rowIslands()[0].get_rows().add(row);
}
Hello,
Thank you for contacting us.
About your question, in order to set cell to be in edit mode you should have CellEditing behavior enabled. Then you can use enterEditMode function which accepts two parameters, the cell that you want to put in edit mode and the key of the column.
For example:
var firstRowIsland = ig_controls.WebHierarchicalDataGrid1.get_gridView().get_rows().get_row(0).get_rowIslands()[0];var cellEditingBehavior = firstRowIsland.get_behaviors().get_editingCore().get_behaviors().get_cellEditing();
var cell = firstRowIsland.get_rows().get_row(0).get_cellByColumnKey("Quantity");
cellEditingBehavior.enterEditMode(cell, "Quantity");
Let me know if I may be of further assistance.
Is there any way to do that for a whole row?
I am using the following code that you provided, It does not cause any errors, but does not either enter Edit Mode
var firstRowIsland = ig_controls.WebHierarchicalDataGrid1.get_gridView().get_rows().get_row(0).get_rowIslands()[0]; var cell = firstRowIsland.get_rows().get_row(0).get_cellByColumnKey("JobNumber"); var grid = ig_controls["WebHierarchicalDataGrid1"].get_gridView(); grid.get_behaviors().get_editingCore().get_behaviors().get_rowEditing().enterEditMode(cell,"JobNumber")