Allow Editing on single column

Hi,

I have a grid with a lot of columns.

Is it possible to allow editing on just a single column without manually specifying AllowEditing="false" on all other columns?

1 Reply 1 reply marked as answer

RN Rahul Narayanasamy Syncfusion Team February 12, 2021 01:12 PM UTC

Hi Liero, 

Greetings from Syncfusion. 

We have validated your query with the provided information. If you want to disable editing for particular column, then you need to define AllowEditing property as false for those columns. This is default behavior. 

Reference

And also we suggest you to refer the below documentation for dynamically build data grid columns. 

Reference

<SfGrid DataSource="@OrderData"> 
    <GridEditSettings AllowEditing="true" AllowAdding="true" AllowDeleting="true"></GridEditSettings> 
    <GridColumns> 
        @foreach (var prop in typeof(Order).GetProperties()) 
        { 
            <GridColumn Field="@prop.Name" IsPrimaryKey="@(prop.Name == "OrderID")" AllowEditing="@(prop.Name == "CustomerID")"></GridColumn//set AllowEditing as true if the Field name matches 
        } 
    </GridColumns> 
</SfGrid> 

Please let us know if you have any concerns. 

Regards, 
Rahul 


Marked as answer
Loader.
Up arrow icon