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
Post a Comment