I've worked with the wpf datagridcontrol for a little while now and I have a couple questions regarding functionality that I seem to want but not that many others on here are posting about. So it leads me to believe that my approach on some things might be a bit flawed since others aren't having the same issues in their production applications. I hope someone reading this can understand my issues and point me in the right path.
Specifically I am referring to the ability to update the itemssource of the grid without losing scroll position/expanded group/focused row and to get/set filter criteria after a itemssource update. These are two things that I always have to write code to do in the past (capture selected stuff, update data, set selected stuff again). Without the code it makes the user experience awful, especially when you get into master/detail style grids. I have a couple of previous posts regarding how to do this in code and the responses have led me to believe that what I was asking to do was an uncommon request with the wpf datagrid. Sometimes I get a "one of our devs said you can try this" but i've not actually gotten those suggestions to work for me.
The way I am accustomed to doing things is almost 100% entirely in code and thus far that is how I have done my wpf and silverlight stuff. It was the most natural progression from what I knew to test out what I could do in wpf.
Back when I purchased my xceed grid license I read about MVVM design patterns but passed it over as taking too much work to implement for the simple requirements of my user interface. I then blindly trudged along working on my application and getting everything to work from minimal markup and runtime code. And then I ran into the issue again of not being able to update my grids without degrading the user experience.
For the meantime on my grids which promote user interaction I am just not running a timer and throwing a refresh button on there. Its definitely not my ideal workaround and I want to learn how I can do this better.
Now I am wondering if I should have worked with MVVM?
My thought is that I can put my data update timers in my viewmodel and they will raise propertychange notifications to my view.
What will that do to my master/detail style grid when the user is deeply scrolled into it and new data arrives? Will it silently update the values in the background or will it collapse all the groups and return the user to row 0? Similar question about the filter criteria. Ideally I would like to set it on the viewmodel and be able for the data update to come in without having to worry with trying to re-apply the filter.
I know others update data in their grids in their production apps without this issue. Otherwise I figure I would have seen a whole lot more topics on the forum regarding it.
Thanks for reading.