Hi,
i am using grid edit mode as row and i have two butons inside the grid. once clicking on any of the button, grid row edit mode is opening.
Is there any way we can avoid grid edit mode for the unbound columns or for the readonly columns.
Thanks
Nitesh
Hello Nitesh,
Thank you for posting in our community.
You can achieve the desired behavior with the use of the Selection feature and handling the rowEditingStarting event of the igGrid. By setting the mode option to “cell” and activation option to “true”, you will be able to select cells without forcing the entire row into edit mode.
In our Updating feature, you will now want to set the editMode: to "row". After this, you can write a function for the editRowStarting event. This event is triggered before the start of row editing and will allow you to control when you want row editing to begin. An example of how the Selection feature and the function should look can be seen in the code snippet below:
cell.index will refer to the column which the active cell is in. It begins at 0 and increments by 1 for each subsequent column. For example, if the readOnly buttons you have exist in the first and fourth column, your if statement will look like:
By returning false, editing is canceled and no editor is shown in the row.
I hope this solves your problem. Please refer to the attached sample for more insight.
Hi Joseph,
One more help , when i am using below code with hierchical grid parant row grid button is working fine with this approach.
but when i am trying with child row grid button the same function returning null.
can you suggest on this.
features.Selection().Mode(SelectionMode.Cell).Activation(true);
.AddClientEvent("editRowStarting", "editRowfun");
function editRowfun(e, ui) {
var cell = $("#grid1").igGridSelection("activeCell"); if (cell.index == 4 || cell.index == 5) { return false; } }
Thanks,
After reading online document i was also at the end that this functionality can be achieved by "editRowStarting" or "editCellStarting". but how i was not able to get that.
But thanks for your quick response, suggested approach work for me.