wpf - Adding to ObservableCollection and ListViewCollection grouping -


i have observablecollection , i'm using listviewcollection provide grouping particular property, in case myproperty.

the problem when add objects observablecollection grouping isn't updated in listview in ui until call .refresh() method on listcollectionview. see data in listview control, isn't grouping.

i'm implementing inotifypropertychanged in stuff object. here example of code.

observablecollection<stuff> mystuff = new observablecollection<stuff>(); mylistview.itemsource = mystuff;  mylistcollectionview =    (listcollectionview)collectionviewsource.getdefaultview(mylistview.itemssource); var groupdescription = new propertygroupdescription("myproperty"); mylistcollectionview .groupdescriptions.add(groupdescription);  stuff newstuff = new stuff(); newstuff.myproperty = "group a"; mystuff.add(newstuff); // once added here, listview shows item, doesn't show correct grouping @ point 

anyone see may doing wrong. in advance pointers.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -