Articles in this section
Category / Section

How to prevent specific rows and cells from editing

2 mins read

It is possible to prevent editing a specific cell, a column or a row in TreeGrid using beginEdit client side event. Editing actions from toolbar edit, context menu edit and mouse click edit can be cancelled using the beginEdit event.

The below code example explains how to prevent the edit action on a specific cell in TreeGrid

<div id="TreeGridContainer" style="height:400px;width:100%"></div>    
<script type="text/javascript">
$(function () {
$("#TreeGridContainer").ejTreeGrid({
//...
dataSource: projectData,
beginEdit: function (args) {
                     //To cancel Edit action for Particular row or column
if (args.data.index == 3 || args.columnIndex == 2)
{
args.cancel = true;
}
//To cancel the Edit for Particular cell
else if (args.data.index == 4 && args.columnIndex == 3)
{
args.cancel = true;
}                  
},      
})
});
</script>

A Sample to prevent the edit action on a specific cell is available in the following link,

Sample

 

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied