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
2275
Case of the Disappearing Row
posted

I'm adding a row in a two way bound xamDataGrid via an ObservableCollection.

When the user clicks an add button, I instantiate a new object of the type in the collection and stuff it with values and make it the ActiveDataItem which I can see on the screen.  Because the text boxes in my detail screen are bound to the ActiveDataItem in the grid, those boxes are populated with the new data.  So far so good.

Then when the user starts changing data in the text boxes, the data in the grid changes which is fine. When the user clicks on the save button, I add the ActiveDataItem to my database and get a new id, and because I'm using two way databinding, the new id shows up in the detail text box and then in the id column in the grid.

So, everything is now great.  The row has been added to my database, and it is also showing in the grid which is exactly what I want.  The problem is now if I click on any other row in the database, the new row I added disappears.  How do I fix this?  

Thank you.

 

Parents
No Data
Reply Children