Esempio n. 1
0
 private void LvColumnClick(object o, ColumnClickEventArgs e)
 {
     try
     {
         if (lv.Visible == true)
         {
             string first = lv.Items[0].SubItems[e.Column].Text;
             string last  = lv.Items[lv.Items.Count - 1].SubItems[e.Column].Text;
             System.Windows.Forms.SortOrder sort_order1 = SortingListView.getSortedOrder(first, last);
             this.lv.ListViewItemSorter = new SortingListView(e.Column, sort_order1);
         }
         else
         {
             string first = lvCopy.Items[0].SubItems[e.Column].Text;
             string last  = lvCopy.Items[lvCopy.Items.Count - 1].SubItems[e.Column].Text;
             System.Windows.Forms.SortOrder sort_order1 = SortingListView.getSortedOrder(first, last);
             this.lvCopy.ListViewItemSorter = new SortingListView(e.Column, sort_order1);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Sorting error");
         MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
     }
 }
Esempio n. 2
0
 private void LvColumnClick(object o, ColumnClickEventArgs e)
 {
     try
     {
         string first = lv.Items[0].SubItems[e.Column].Text;
         string last  = lv.Items[lv.Items.Count - 1].SubItems[e.Column].Text;
         System.Windows.Forms.SortOrder sort_order1 = SortingListView.getSortedOrder(first, last);
         this.lv.ListViewItemSorter = new SortingListView(e.Column, sort_order1);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Sorting error");
     }
 }