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

How to disable the edit mode of AddNewRow in SfDataGrid when AllowEditing is set as False?

SfDataGrid allows you to disable the edit mode. You can do so by setting the AllowEditing property as False. Conversely, the AddNewRow is always editable, despite AllowEditing being false. This is because, AddNewRow allows you to add rows in the runtime to enter new records in the DataGrid control. On the other hand, you can disable the edit mode of AddNewRow in SfDataGrid, by handling the CurrentCellBeginEdit event. To set a particular column as read-only, you can specify the AllowEditing property of that column alone as False.

The following code example demonstrates how to disable the edit mode of a column in AddNewRow by handling CurrentCellBeginEdit event.

C#

 

The above code makes the selected columns read-only, by cancelling the editing feature of the columns, for which the AllowEditing property is set as false. Specifying AllowEditing as False for the grid disables the edit mode of the entire AddNewRow.

 

 

 

 

 

 

Screenshot:

Figure 1: Disable the edit mode of AddNewRow

Sample Link:

WPF

WRT

Silverlight

UWP

 

Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework:
2497 08/13/2014 02/05/2016 WinRT SfDataGrid 4.5
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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