I have a datagrid which is bound to an Observable collection in my view model.
The items source property is set to the collection.
Every time I update the collection ( through another button ) , my datagrid view updates and i am able to see the changes .
I want to make sure that atleast one item in the WPF datagrid is selected always .
I tried making Selected Index =0 in the Datagrid XAML , but this works only for initially Loaded datagrid. It doesnt reset the selected index to 0 when the Items source collection is changed . By changed I mean the entire Colelction is reset ( not individual items being added or removed).
Basically I need an event that gets fired from WPF whenever the itemssource collection is reset.
not sure if any code here is helfpul.