sorting - Orderby() on observablecollections in silverlight does not work -


my code is,

destmenu.add(selectedmenu); observablecollection<menumodel> temp =  (observablecollection<menumodel>)destmenu.orderby(p =>(p.menuname)); destmenu = temp; 

here, selectedmenu new item added collection. temp dummy collection swap. and, when try convert sorted collection, if any, observablecollection, throws exception.

can me sort collection , make me understand problem in code?

thanks manikandan

i got trick.

destmenu.add(selectedmenu); ienumerable<menumodel> temp = destmenu.orderby(p =>(p.menuname)); destmenu = new observablecollection<menumodel>(temp); 

this works , destmenu has sorted collection now.

thanks manikandan


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -