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. Image for the cookie policy date

Set readonly some cells

Hello,

How to set read only some cells based on their data?

Thanks!

1 Reply

MK Mahalakshmi Karthikeyan Syncfusion Team November 26, 2015 11:59 AM UTC

Hi Jorge,

Thanks for contacting Syncfusion support.

We can make any field or particular cell read only with the help of “BeginEdit” client side event. Please refer the below code example for details.

<ej:treegrid ID="Treegrid" runat="server"

//…

BeginEdit="beginedit">

<script type="text/javascript">

      function beginedit(args) {

          if (args.columnIndex == 5 && parseInt(args.data.PercentDone) > 100) {

              args.cancel = true;

          }

      }

  </script>

Here we have cancelled the editing event when we attempt to edit the percentage column value is greater than 100.

We have also prepared a sample based on this, and you can find the sample under the following location.

Sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/cellEdit1796809052

Regards,

Mahalakshmi K.


Loader.
Up arrow icon