89
Views
2
Comments
Solved
Read only Rows of Data grid
Application Type
Traditional Web

Hi Team,

I want to make my rows Read only of Data Grid based upon some Status. How Can I achieve this?

Example:

I am having one status column having values of Approved and Rejected. If Status is Approved then that row should be read only.


Thanks

Sourav

2025-10-18 11-13-53
Ramesh subramanian
Solution
2022-04-15 04-42-41
Tanisha Mahendru
Solution

Hi Sourav

You can add the below code:

var makeReadonlyCell = function(gObj)

{    

gObj.grid.beginningEdit.addHandler((s,e) => {      

  var _flexGrid = gObj.grid;             if(_flexGrid.getCellData(s.selection.row, _flexGrid.columns.getColumn('StatusId').index) === 8 )            

 {                     e.cancel = true;          

    }   

  }

);}

Get the Status index from the entity and mention above in the If condition.

I hope this helps you.

Regards 

2025-10-18 11-13-53
Ramesh subramanian
Solution
2022-04-15 04-42-41
Tanisha Mahendru
Solution

Hi Sourav

You can add the below code:

var makeReadonlyCell = function(gObj)

{    

gObj.grid.beginningEdit.addHandler((s,e) => {      

  var _flexGrid = gObj.grid;             if(_flexGrid.getCellData(s.selection.row, _flexGrid.columns.getColumn('StatusId').index) === 8 )            

 {                     e.cancel = true;          

    }   

  }

);}

Get the Status index from the entity and mention above in the If condition.

I hope this helps you.

Regards 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.