Hi Guys,
I'm working with a xamDataGrid, binded to an ObservableCollection<T>. This collection is updated from a different thread than the UI one. The issue that I'm having is that, if I click on an any given row on the grid in order to select that row, when the Collection gets updated, the Grid looses the focus, therefore the row selected looses the focus.
How can I solve this?
Thanks in advance!
Regards,
Pablo
Hello Pablo,
Thank you for your post. I am very glad that you have managed to solve the issue that you were having. Please let me know if I can assist you with anything else.
Sincerely,
Krasimir, MCPD
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
Hello Krasimir,
thank you for your reply. Your example Works just fine, but it always add records to the collection. My App it's a trading client, and I need to keep the collection of Quotes updated according on how the prices are changing. I was upadting the collection in terms of delete/insert on it. Now I've changed this approach by seeking and updating the objects on the collection and this solution worked just fine.
I'm also bind the collection to the xamDataGrid, using the DataSource property instead of DataConext, and I implement INotifyCollectionChanged over the collection instead of
INotifyPropertyChanged over the entitie.
I hop this could be helpfull to others.
Thank you very much!
Thank you for your email. I have been looking into the behavior that you have described and I could not managed to reproduce it. I have created a sample application that has a XamDataGrid bound to an ObservableCollection<T> and each second, through a different thread, I am changing the values of the properties of each item in the collection. When I select a record, it stay selected after the updates.
Would you please let me know if you can reproduce the same behavior with my sample application and if not, would you modify my sample application to show the issue or send me an isolated sample application, in order to be able to research what might be the reason for the behavior?
Looking forward to hearing from you.
Krasimir
Developer Support Engineer