I have a hierarchical XamGrid which has it's item source set to:an observableCollection of consisting of my own created FileType each of which implement INotifyChange interface. The FileType contains FileName and VersionNo and other info
The FileType has an ObservableCollection called Versions that contains FileName and Version number
In order to display the data, i have to set the data grid itemsource to null, then assign the observableCollection of FileType to the grid itemsource property.
When the user clicks on a row, i gather the Versions info and update the Versions ObservableCollection for the particular FileType. So if File1 has 3 versions, I add that to the Versions for File1.
Now, when I do that, I want the XamGrid to show the change in the UI. Right now it is not working. I have to set the itemsource to null and re-bind the updated Observable collection of FileType to it
Hi,
So, FileType has a property called Versions, which is an ObesrvableCollection, right?
Then you update the Versions property. Are you adding to an empty collection, or assigning a new ObservableCollection to the property?
If you're assigning a new OC, are you raising the the PropertyChanged event for the versions property when you assign it?
-SteveZ
Q1 - Answer: Yes
Q2 - Answer: Adding to an empty collection
Q3: Answer: Yes
Actually I have fixed the problem. The issue was that I assigned the DataContext to the FileType and resetting it each time. By removing it and then just assigning ItemSource to the FileType, it worked.
Thanks