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

grid row disabled

Hi Team,

I want to disabled specific rows but i didnt find how to do.

Thanks in advance

5 Replies

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team November 12, 2019 01:49 PM UTC

Hi Serdar,

We suspect that you would like to disable editing for particular rows based on the value. We have already discussed about this in the following Help document.  

Regards,  
Seeni Sakthi Kumar S 



serdar çelebi November 12, 2019 01:55 PM UTC

thanks for reply.

i want to disabled like this link "https://ej2.syncfusion.com/angular/documentation/grid/how-to/enable-disable-grid-and-its-actions/" and this examples disabled all grid rows but i didnt find specific rows.


SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team November 13, 2019 06:39 AM UTC

Hi Serdar , 
 
Greetings from Syncfusion 
 
We have validated your query and attached a working sample. In the below sample we used the actionBegin event and a rowDataBound to achieve your requirement. Here we have disabled the alternate rows using a modulo condition. Refer to the code example. 
 
    <ejs-grid #grid [dataSource]='data' [editSettings]='edit' (actionBegin)='actionBegin($event)' (rowDataBound)='rowDataBound($event)' > 
        <e-columns> 
            <e-column field='OrderID' isPrimaryKey='true' headerText='Order ID' width='120' textAlign='Right'></e-column> 
                  . ..  
                   . . .  
        </e-columns> 
    </ejs-grid> 
 
 
App.component.ts 
 
    actionBegin (args) { 
       if (args.requestType === 'beginEdit' && args.row.classList.contains('e-disabled')) { 
        args.cancel = true; 
      } 
    } 
    rowDataBound(e) { 
      if(e.data.OrderID % 2 === 0) { 
        e.row.classList.add('e-disabled'); 
      } 
    } 
 
 

Please get back to us if you need further assistance 

Regards,
Seeni Sakthi Kumar S 



WP william peterson November 21, 2019 03:00 PM UTC

Using the actionBegin event of Grid is what you need as far as I can say. For batch mode of editing, you can use CellEdit event of Grid.


SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team November 22, 2019 06:40 AM UTC

Hi William,

Yes, similar to the normal edit mode, batch edit mode uses the cellEdit event for cell manipulation. Thanks for your suggestion.

https://ej2.syncfusion.com/angular/documentation/api/grid/#celledit

Regards,  
Seeni Sakthi Kumar S 


Loader.
Live Chat Icon For mobile
Up arrow icon