public static void UpdateListComparer(ListView view, int selected_column)
        {
            if (view != null)
            {
                ListItemComparer comparer = view.ListViewItemSorter as ListItemComparer;

                if (comparer != null)
                {
                    if (selected_column != comparer.Column)
                    {
                        comparer.Column    = selected_column;
                        comparer.Ascending = true;
                    }
                    else
                    {
                        comparer.Ascending = !comparer.Ascending;
                    }

                    view.Sort();
                }
            }
        }
 private void listView_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     ListItemComparer.UpdateListComparer(sender as ListView, e.Column);
 }