Hey guys,
I have a RESTful server I've created which stores simple objects with a few fields. I have a WPF project that has a RadGridView. It loads these objects just fine from my server. I've also managed to use both the AddingNewDataItem and RowEditEnded listeners to be able to 1) listen for a user creating a new row, 2) create an object on the server with the user's specified fields and 3) store the newly created object returned from the server (with a unique ID) in an ObservableCollection linked to the GridView.
Here's the problem. If I submit the new object to the server via the AddingNewDataItem listener, I can successfully add it to my ObservableCollection. The way the GridView UI works, however, it immediately brings up a selected row with edit enabled upon hitting insert or clicking on the "insert new row" bar. I have not figured out how to update this UI element with the data from the server. I've tried this many, many different ways, but the UI element that opens remains the same. What I have been able to successfully do is replace that row **after** using the RowEditEnded listener. This kinda works but looks odd as certain fields change after the user is done editing and there's no reason I couldn't just show the unique ID retrieved from the server, for example, **before** editing is complete. I've also tried to use AddingNewDataItem listener to listen for the insert request, create a blank object on the server with a new unique ID, and show that object data in the newly created and displayed selected, editable row in the GridView. I have not figured out a way to do this, however. I am able to successfully create a new object on my server and to add that object to my Observable Collection, but I can't seem to find a way to update the data in the newly added row in the UI before the edit is complete. I feel like I've tried so many different ways of trying to find and replace the incorrect objects in the GridView.Items and GridView.Itemsource collections, but to no avail.
Surely there's an easy way to do this? Thanks in advance! Let me know if you need more info. I could provide code, but I think this is more of a conceptual issue I need to figure out as I've tried to do this like literally 15 different ways. They all sort of work, but don't let me update the UI when I want to do it, so I suspect I'm missing a method or event handler that is more suited to what I'm trying to do.