Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
860
How to refer to a newly added item in a XamDataGrid
posted

I am using MVVM in my app. 

There are two XamDataGrids in the window, in a Master(Customer) and Detail(Order) relationship.

I set "AllowAddNew" to true in the Master. 

I am trying to link the Master and Detail together when adding a new Customer into Master.

The ActiveDataItem in the Master is bidden to the "SelectedCustomer" property in the view model, the datasource of the Detail is bidden to SelectedCustomer.Orders.

When adding a new Customer in the Master, the RecordAdded event fires, I check the SelectedCustomer property when RecordAdded fired, the property is null, hence, I am not able to set the datasource of the Detail.

How can I set the datasource of the Detail to the newly added Customer's Order list?

Thanks.