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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to do AddNewRow operations programmatically in the SfDataGrid?

In the SfDataGrid, AddNewRow allows you to add the new data row in the UI by entering new records. By default, the new row is added at the end, otherwise it is added based on the sorted data position when LiveUpdateMode is set as AllowDataShapping.

The following screenshot shows the default view of AddNewRow in the SfDataGrid.

 

http://www.syncfusion.com/uploads/user/kb/wpf/wpf-20241/wpf-20241_img1.png

Figure 1 : Default view AddNewRow

When adding a new row, you can commit the new row by pressing the Enter key and cancel committing the new row by pressing the ESC key twice.

 

You can perform these operations programmatically in run time also.

The following code example illustrates how to cancel the new row being committed by calling AddNewRowController.CancelAddNew method.

C#

Similarly, you can also commit the new row programmatically using CommitAddNew method.

C#

 

Sample Links:

WPF

WinRT

UWP

 

Article ID: Published Date: Last Revised Date: Platform: Control:
5918 12/30/2015 01/20/2016 UWP SfDataGrid
Tags:
Did you find this information helpful?
Comments
Milan Vora Jan 23, 2017
How to add a blank new row and edit it programaticaaly?
Reply
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