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

Is there a property to obtain the current NewRow Entity ?

Thread ID:





121707 Jan 18,2016 03:24 PM UTC Jan 19,2016 12:53 PM UTC WPF 1
Tags: SfDataGrid
Asked On January 18, 2016 03:24 PM UTC


I'm binding a SfDatagrid to a detail form using the SelectedItem property, for example in this way:

  SelectedItem="{Binding Path=Selection, Mode=TwoWay}"  

where "Selection" is a suitable member on my ViewModel class.
This works very good.

However when the user is inserting a new record on the grid (using the AddNewRowInitiating event), the SelectedItem property is null.
So I don't have any binding on the detail form to the new created record until the record is really inserted in the datagrid.
But I would like to have a property (or a method) in the datagrid to obtain also the currenctly adding record.
Is there any possibility to obatain this record?

I've also thougth this workaroud. I have this method when I insert a new record:

        private void SfDataGrid_AddNewRowInitiating(object sender, Syncfusion.UI.Xaml.Grid.AddNewRowInitiatingEventArgs args)
          args.NewObject = new CustomerDTO();

I could save this newly created record (CustomerDTO) in a private field of the form. And then define a my own property to return it.
But what event must I join in order to set this field to null when the record is added to the datagrid and it not yet bindend to the "add new Row"?

So what can you suggest me to solve this problem ?


Sowndaiyan Paulpandi [Syncfusion]
Replied On January 19, 2016 12:53 PM UTC

Hi Silvio,

Thanks for contacting Syncfusion Support.

We have analyzed your query. You can achieve your requirement “Set the private field CustomerDTO as null” by using the RowValidated event like the below code example,

Code Example [ C# ]

sfdatagrid.RowValidated += sfdatagrid_RowValidated;

void sfdatagrid_RowValidated(object sender, RowValidatedEventArgs args)



// here you can set your private field as null
        CustomerDTO = null;





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