c# - WPF Listview sort works only one time, and then nothing happen -


i have listview in wpf window, trying sort clicking on columns. learn how this, followed link: http://www.wpf-tutorial.com/listview-control/listview-how-to-column-sorting/

i have created method gridviewcolumnheader_cick follow:

private void gridviewcolumnheader_click(object sender, routedeventargs e) {     gridviewcolumnheader column = (sender gridviewcolumnheader);     string sortby = column.tag.tostring();     searchresultlistview.items.sortdescriptions.clear();     searchresultlistview.items.sortdescriptions.add(new sortdescription(sortby, listsortdirection.ascending)); } 

it works first time click on column header, if click on column header after, nothing happen. tried execute step-by-step, not find cause this.

check if didn't copy-paste columns same tag in xaml.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -