Prevent Column from showing a textbox

When clicking on a row for editing is it possible to prevent columns from becoming text fields? i.e.  Leave them as plain text. Only on certain columns.


1 Reply

MS Monisha Saravanan Syncfusion Team February 21, 2022 01:10 PM UTC

Hi John, 

Greetings from Syncfusion support. 

We have analyzed your query and we suspect that you want to display an plain text on clicking certain row for editing. So we suggest you to use the edit template feature of DataGrid. By using edit template we can customize our own way of editing for Grid columns. Kindly refer the below code snippet and UG for your reference. 

<SfGrid DataSource="@Orders" AllowFiltering="true" Toolbar="@(new List<string>() { "Add", "Delete", "Update", "Cancel", "Search" })"> 
   <GridEditSettings AllowEditing="true" AllowDeleting="true" AllowAdding="true"></GridEditSettings> 
   
   <GridColumns> 
    ...  
   <GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150"> 
        <EditTemplate> 
             @{ 
                 var data = (context as Order); 
                 @data.CustomerID; 
             } 
 
         </EditTemplate> 
     </GridColumn> 
</SfGrid> 
 


Kindly get back to us if you have further queries or if we misunderstood your query. 

Regards, 
Monisha 


Loader.
Up arrow icon