sorting - Sort Item in ListView by Attribute Windows phone 8.1 RT -


i want sort item in listview attribute. it's not working. try

lview.orderby(p=>p.attribute);  list<object> lvnew = lview.itemssource list<object>; lvnew.sort(story.cmp_new);  public static int cmp_new(story a, story b)     {         return (int16.parse(a.storyid) > int16.parse(b.storyid)) ? 0 : 1;     } 

help me friend

i know i'm late if can : sort list of objects have extends object's class icomparable add method in class :

public int compareto(object obj) {     var second = obj yourclass;     return yourattribute.compareto(second.yourattribute); } 

last, have call sort method on yout list :

list<yourclass> mylist = ... mylist.sort(); 

Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -