We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Make certain cells in a grid row read only based on the value of a cell in the row

Thread ID:





126212 Sep 30,2016 09:18 PM UTC Oct 3,2016 12:14 PM UTC ASP.NET MVC 1
Tags: Grid
Jason Black
Asked On September 30, 2016 09:18 PM UTC

I'm trying make certain cells in a grid row read only(non editable) based on the value of a cell in that row.  I'm using the following script and it seems to set the property to true but it still allows me to edit those cells.

function RowDataBound(args)
    var IsHostRep = args.data["IsHost"];
    var currentrow = args.model.currentIndex;
    if (args.data.IsHost == 1)
        args.row[currentrow].cells[1].disabled = true;

Prasanna Kumar Viswanathan [Syncfusion]
Replied On October 3, 2016 12:14 PM UTC

Hi Jason, 
Thanks for contacting Syncfusion support. 
To make a cell non-editable based on its value, use actionComplete event of ejGrid. The actionComplete event triggered for every grid action success event. In actionComplete event, we check the condition with the requestType and disable the EmployeeID cell by adding disabled attribute and disable class when it has a value of 5. 
Find the code example and sample: 
       .EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing(); }) 
       .ToolbarSettings(toolbar => 
           toolbar.ShowToolbar().ToolbarItems(items => 
       .Columns(col => 
       .ClientSideEvents(eve => { eve.BeginEdit("beginEdit"); }) 
    function beginEdit(args) { 
if(args.requestType == "beginedit") { 
        var data = args.row.find("input"); 
        for (var i = 0 ; i < data.length ; i++) { 
            if (data[i].name == "EmployeeID" && parseInt($(data[i]).attr("value")) == 5) { 
      }    } 
Refer to the Help document for the actionComplete event. 
Prasanna Kumar N.S.V 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon