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

After Adding New Row, force it to commit

Thread ID:





107902 Mar 21,2013 09:51 PM UTC May 14,2013 10:20 AM UTC WPF 1
Tags: GridControl
Paul McCranie
Asked On March 21, 2013 09:51 PM UTC

I am using the Syncfusion DataGrid. It has an empty row at the top to Add New Records. If I add a new record and then click on another row, it WILL save it. If I click away from the grid after adding a new record, it will not save.

I need the code that will force the datagrid to commit that new row that was created without forcing my users to click on another row or even expecting them to hit enter.

I want to programmtically force the grid to save the new row.


Rajasekar G [Syncfusion]
Replied On May 14, 2013 10:20 AM UTC

Hi Paul,


Thanks for the patience.


We have analyzed your query and we have achieve your requirement by using the following code snippet.


Code Snippet[C#]:

this.AssociatedObject.CurrentCellChanged += new Syncfusion.Windows.ComponentModel.GridRoutedEventHandler(AssociatedObject_CurrentCellChanged);
void AssociatedObject_CurrentCellChanged(object sender, Syncfusion.Windows.ComponentModel.SyncfusionRoutedEventArgs args)
    int rowindex = this.AssociatedObject.Model.CurrencyManager.CurrentCell.RowIndex;
    int columnindex = this.AssociatedObject.Model.CurrencyManager.CurrentCell.ColumnIndex;
    var style = this.AssociatedObject.Model[rowindex, columnindex] as GridDataStyleInfo;
    if (style.CellIdentity.TableCellType == GridDataTableCellType.AddNewRecordCell && columnindex == this.AssociatedObject.Model.ColumnCount - 1)
        //you can commit the added new record by using the following code snippet
        if (this.AssociatedObject.Model.CurrencyManager != null)



For your reference we have prepared a sample based on this and it can be download from the following location.


Sample Location: GridDataControl_AddNewRow.zip


Please let us know if you have any questions.





This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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