Пример #1
0
        private void lvClientes_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            sorter.SetTipoComparacion(GI.Framework.ListView.ListViewColumnSorter.TipoComparacion.STRING);

            if (e.Column == sorter.SortColumn)
            {
                // Reverse the current sort direction for this column.
                if (sorter.Order == SortOrder.Ascending)
                {
                    sorter.Order = SortOrder.Descending;
                }
                else
                {
                    sorter.Order = SortOrder.Ascending;
                }
            }
            else
            {
                // Set the column number that is to be sorted; default to ascending.
                sorter.SortColumn = e.Column;
                sorter.Order = SortOrder.Ascending;
            }

            // Perform the sort with these new sort options.
            this.lvClientes.Sort();
        }
        public void HandleColumnClicked(System.Windows.Forms.ListView listView, ColumnClickEventArgs e)
        {
            // Determine if clicked column is already the column that is being sorted.
            if (e.Column == this.SortColumn)
            {
                // Reverse the current sort direction for this column.
                if (this.Order == SortOrder.Ascending)
                {
                    this.Order = SortOrder.Descending;
                }
                else
                {
                    this.Order = SortOrder.Ascending;
                }
            }
            else
            {
                // Set the column number that is to be sorted; default to ascending.
                this.SortColumn = e.Column;
                this.Order = SortOrder.Ascending;
            }

            // Perform the sort with these new sort options.
            listView.Sort();            
        }
Пример #3
0
        private void lv_controls_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            // Determine if clicked column is already the column that is being sorted.
            if (e.Column == lvwColumnSorter.SortColumn)
            {
                // Reverse the current sort direction for this column.
                if (lvwColumnSorter.Order == SortOrder.Ascending)
                {
                    lvwColumnSorter.Order = SortOrder.Descending;
                }
                else
                {
                    lvwColumnSorter.Order = SortOrder.Ascending;
                }
            }
            else
            {
                // Set the column number that is to be sorted; default to ascending.
                lvwColumnSorter.SortColumn = e.Column;
                lvwColumnSorter.Order = SortOrder.Ascending;
            }

            // Perform the sort with these new sort options.
            lv_controls.Sort();
        }
Пример #4
0
        private void lstFiles_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            // check if the selected column is already sorted
            if (e.Column == listViewFilesSorter.SortColumn)
            {
                // Inverse sort order
                if (listViewFilesSorter.Order == SortOrder.Ascending)
                {
                    listViewFilesSorter.Order = SortOrder.Descending;
                }
                else
                {
                    listViewFilesSorter.Order = SortOrder.Ascending;
                }
            }
            else
            {
                // sort ascending on this column
                listViewFilesSorter.SortColumn = e.Column;
                listViewFilesSorter.Order = SortOrder.Ascending;
            }

            // Sort list
            lstFiles.Sort();
        }
Пример #5
0
 private void listView1_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     if (e.Column == 0)
     return;
       else if (e.Column == 1)
     ColumnSorter.NumSort = true;
       else
     ColumnSorter.NumSort = false;
       if (e.Column == ColumnSorter.SortColumn)
       {
     // Reverse the current sort direction for this column.
     if (ColumnSorter.Order == SortOrder.Ascending)
       ColumnSorter.Order = SortOrder.Descending;
     else
       ColumnSorter.Order = SortOrder.Ascending;
       }
       else
       {
     // Set the column number that is to be sorted; default to ascending.
     ColumnSorter.SortColumn = e.Column;
     ColumnSorter.Order = SortOrder.Ascending;
       }
       // Perform the sort with these new sort options.
       listView1.Sort();
 }
Пример #6
0
        private void listView1_ColumnClick(object sender,
                                           System.Windows.Forms.ColumnClickEventArgs e)
        {
            ListView myListView = (ListView)sender;

            // Determine if clicked column is already the column that is being sorted.
            if (e.Column == lvwColumnSorter.SortColumn)
            {
                // Reverse the current sort direction for this column.
                if (lvwColumnSorter.Order == SortOrder.Ascending)
                {
                    lvwColumnSorter.Order = SortOrder.Descending;
                }
                else
                {
                    lvwColumnSorter.Order = SortOrder.Ascending;
                }
            }
            else
            {
                // Set the column number that is to be sorted; default to ascending.
                lvwColumnSorter.SortColumn = e.Column;
                lvwColumnSorter.Order      = SortOrder.Ascending;
            }

            // Perform the sort with these new sort options.
            myListView.Sort();
        }
Пример #7
0
        private void listView1_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
        {
            ItemComparer ordernar = listView1.ListViewItemSorter as ItemComparer;

            if (ordernar == null)
            {
                ordernar       = new ItemComparer(e.Column);
                ordernar.Order = SortOrder.Ascending;
                listView1.ListViewItemSorter = ordernar;
            }
            // Se a coluna clicada ja for a que estiver a ser ordenada
            if (e.Column == ordernar.Column)
            {
                // Altera a direção da ordenação
                if (ordernar.Order == SortOrder.Ascending)
                {
                    ordernar.Order = SortOrder.Descending;
                }
                else
                {
                    ordernar.Order = SortOrder.Ascending;
                }
            }
            else
            {
                // Altera o numero da coluna que estamos a ordenar e mete por defeito a ordem ascendente.
                ordernar.Column = e.Column;
                ordernar.Order  = SortOrder.Ascending;
            }
            listView1.Sort();
        }
Пример #8
0
        private static void listView_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
        {
            ListView lv = (ListView)sender;

            ShowInfoMessageBox(lv.Columns[e.Column].Text);
            if (lv.Items.Count == 0)
            {
                return;
            }

            DataTable dt       = new DataTable();
            int       colCount = lv.Columns.Count;

            string[] columns = new string[colCount];
            for (int i = 0; i < colCount; i++)
            {
                string colText = lv.Columns[i].Text.Trim();
                columns[i] = colText;
                dt.Columns.Add(colText);
            }
            foreach (ListViewItem lvi in lv.Items)
            {
                string[] row = new string[colCount];
                for (int i = 0; i < colCount; i++)
                {
                    row[i] = lvi.SubItems[i].Text.Trim();
                }
                dt.Rows.Add(row);
            }
            DataRow[] drs = dt.Select(string.Empty, lv.Columns[e.Column] + " asc");
            BindListViewData(lv, drs, columns);
        }
Пример #9
0
        private void _lstConstantes_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            _lstConstantes.SuspendLayout();

            // Determine whether the column is the same as the last column clicked.
            if (e.Column != _lstConstantesSortColumn)
            {
                // Set the sort column to the new column.
                _lstConstantesSortColumn = e.Column;
                // Set the sort order to ascending by default.
                _lstConstantes.Sorting = SortOrder.Ascending;
            }
            else
            {
                // Determine what the last sort order was and change it.
                if (_lstConstantes.Sorting == SortOrder.Ascending)
                    _lstConstantes.Sorting = SortOrder.Descending;
                else
                    _lstConstantes.Sorting = SortOrder.Ascending;
            }

            // Call the sort method to manually sort.
            _lstConstantes.Sort();
            // Set the ListViewItemSorter property to a new ListViewItemComparer
            this._lstConstantes.ListViewItemSorter = new ListViewItemComparer(e.Column, _lstConstantes.Sorting);

            _lstConstantes.ResumeLayout();
            Cursor.Current = Cursors.Default;
        }
Пример #10
0
        private void ListHeader_Click(object sender, ColumnClickEventArgs e)
        {
            bool currSortAsc = _listView.ListViewItemSorter is FieldComparer ? ((FieldComparer)_listView.ListViewItemSorter).Ascending : false;
            int currSortIx = _listView.ListViewItemSorter is FieldComparer ? ((FieldComparer)_listView.ListViewItemSorter).ColumnIndex : -1;

            this._listView.ListViewItemSorter = new FieldComparer(e.Column, currSortIx != e.Column ? true : !currSortAsc);
        }
Пример #11
0
        public void ListItemSorter(object sender, ColumnClickEventArgs e)
        {
            ListView list = (ListView)sender;
            int total = list.Items.Count;
            list.BeginUpdate();
            ListViewItem[] items = new ListViewItem[total];
            for (int i = 0; i < total; i++)
            {
                int count = list.Items.Count;
                int minIdx = 0;
                for (int j = 1; j < count; j++)
                {
                    bool test = XFerListColumnCompare(list.Items[j], list.Items[minIdx], e.Column);
                    if ((cols[e.Column] == SortOrder.Ascending && test) ||
                        (cols[e.Column] == SortOrder.Descending && !test))
                        minIdx = j;
                }

                items[i] = list.Items[minIdx];
                list.Items.RemoveAt(minIdx);
            }
            list.Items.AddRange(items);
            list.EndUpdate();
            if (cols[e.Column] == SortOrder.Descending)
                cols[e.Column] = SortOrder.Ascending;
            else if (cols[e.Column] == SortOrder.Ascending)
                cols[e.Column] = SortOrder.Descending;
        }
Пример #12
0
 public static void ListView_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     ListView LV = sender as ListView;
     if (LV == null)
     {
         return;
     }
     ListViewColumnSorter S = LV.ListViewItemSorter as ListViewColumnSorter;
     if (S == null)
     {
         S = new ListViewColumnSorter();
         LV.ListViewItemSorter = S;
         S.Column = -1;
     }
     if (S.Column == e.Column)
     {
         S.Order = ((S.Order == SortOrder.Ascending) ? SortOrder.Descending : SortOrder.Ascending);
     }
     else
     {
         S.Column = e.Column;
         S.Order = SortOrder.Ascending;
     }
     LV.Sort();
 }
        public static void ListColumnClick( ColumnClickEventArgs e )
        {
            ListViewEx ShortLivedListView = OwnerWindow.ShortLivedListView;

            if( ShortLivedListView.Items.Count == 0 )
            {
                return;
            }

            if( e.Column == ColumnToSortBy )
            {
                ColumnSortModeAscending = !ColumnSortModeAscending;
            }
            else
            {
                ColumnToSortBy = e.Column;
                ColumnSortModeAscending = false;
            }

            int[] NewColumnMapping = new int[ ShortLivedColumnMapping.Length ];
            for( int MappingIndex = 0; MappingIndex < NewColumnMapping.Length; MappingIndex++ )
            {
                NewColumnMapping[ MappingIndex ] = ShortLivedColumnMapping[ MappingIndex ];

                if( ShortLivedColumnMapping[ MappingIndex ] < ShortLivedColumnMapping[ e.Column ] )
                {
                    NewColumnMapping[ MappingIndex ]++;
                }
            }
            NewColumnMapping[ e.Column ] = 0;

            // copy items to a temp array because the ListViewItemCollection doesn't have a Sort method
            ListViewItem[] TempItems = new ListViewItem[ ShortLivedListView.Items.Count ];
            uint[] TempValues = new uint[ ShortLivedColumnMapping.Length ];
            for( int MappingIndex = 0; MappingIndex < TempItems.Length; MappingIndex++ )
            {
                FShortLivedCallStackTag Tag = ( FShortLivedCallStackTag )ShortLivedListView.Items[ MappingIndex ].Tag;
                for( int j = 0; j < Tag.ColumnValues.Length; j++ )
                {
                    TempValues[ NewColumnMapping[ j ] ] = Tag.ColumnValues[ ShortLivedColumnMapping[ j ] ];
                }

                uint[] OldValues = Tag.ColumnValues;
                Tag.ColumnValues = TempValues;
                // reuse old array for next value swap
                TempValues = OldValues;

                TempItems[ MappingIndex ] = ShortLivedListView.Items[ MappingIndex ];
            }

            Array.Sort<ListViewItem>( TempItems, CompareShortLivedColumns );

            ShortLivedListView.BeginUpdate();
            ShortLivedListView.Items.Clear();
            ShortLivedListView.Items.AddRange( TempItems );
            ShortLivedListView.SetSortArrow( ColumnToSortBy, ColumnSortModeAscending );
            ShortLivedListView.EndUpdate();

            ShortLivedColumnMapping = NewColumnMapping;
        }
Пример #14
0
        private void SPMListView_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            // Determine whether the column is the same as the last column clicked.
            if (e.Column != sortColumn)
            {
                // Set the sort column to the new column.
                sortColumn = e.Column;
                // Set the sort order to ascending by default.
                this.Sorting = SortOrder.Ascending;
            }
            else
            {
                // Determine what the last sort order was and change it.
                if (this.Sorting == SortOrder.Ascending)
                    this.Sorting = SortOrder.Descending;
                else
                    this.Sorting = SortOrder.Ascending;
            }
            // Set the ListViewItemSorter property to a new ListViewItemComparer
            // object.
            this.ListViewItemSorter = new ListViewItemComparer(e.Column,
                                                              this.Sorting);

            // Call the sort method to manually sort.
            this.Sort();
        }
Пример #15
0
 private void listView1_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     switch (e.Column)
     {
         case 0:
             listView1.ListViewItemSorter = new ColumnSorter(0);
             listView1.Sort();
             break;
         case 1:
             listView1.ListViewItemSorter = new ColumnSorter(1);
             listView1.Sort();
             break;
         case 2:
             listView1.ListViewItemSorter = new ColumnSorter(2);
             listView1.Sort();
             break;
         case 3:
             listView1.ListViewItemSorter = new ColumnSorter(3);
             listView1.Sort();
             break;
         case 4:
             listView1.ListViewItemSorter = new ColumnSorter(4);
             listView1.Sort();
             break;
     }
 }
Пример #16
0
        private void viewAssetList_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            if (e.Column == lvmColumnSorter.SortColumn)
            {
                // Reverse the current sort direction for this column.
                if (lvmColumnSorter.Order == SortOrder.Ascending)
                {
                    lvmColumnSorter.Order = SortOrder.Descending;
                }
                else
                {
                    lvmColumnSorter.Order = SortOrder.Ascending;
                }
            }
            else
            {
                // Set the column number that is to be sorted; default to ascending.
                lvmColumnSorter.SortColumn = e.Column;
                lvmColumnSorter.Order = SortOrder.Ascending;
            }

            // Perform the sort with these new sort options.
            this.assetListView.Sort();
            if (Properties.Settings.Default.playSounds)
                Sound.Click.Play();
        }
Пример #17
0
 private void lvset_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     lvset.ListViewItemSorter = (e.Column == 0)
         ? new Sort(e.Column, 0 == (ModifierKeys & Keys.Shift))
         : new Sort(e.Column, 0 != (ModifierKeys & Keys.Shift))
     ;
 }
Пример #18
0
 private void lvwColumns_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
 {
     // Set the ListViewItemSorter property to a new ListViewItemComparer object.
     this.lvwColumns.ListViewItemSorter = new ListViewItemComparer(e.Column);
     // Call the sort method to manually sort the column based on the ListViewItemComparer implementation.
     lvwColumns.Sort();
 }
Пример #19
0
 private void featureList_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     bool diffCol = _lastColumnClicked != e.Column;
     _ascending = (diffCol) ? true : !_ascending;
     this.featureList.ListViewItemSorter = new FeatureListViewItemComparer(e.Column, featureList.Columns.Count - 1, _ascending);
     _lastColumnClicked = e.Column;
 }
 private void listView1_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     columnSorter.SortColumn = e.Column;
     listView1.Sorting = listView1.Sorting == SortOrder.Ascending ? SortOrder.Descending : SortOrder.Ascending;
     columnSorter.Order = listView1.Sorting;
     listView1.Sort();
 }
Пример #21
0
        private void listView1_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            ListView lv = (sender as ListView);
            if (lv != null)
            {
                Utils.ListViewColumnSorter lvcs = (lv.ListViewItemSorter as Utils.ListViewColumnSorter);
                if (lvcs != null)
                {
                    // Determine if clicked column is already the column that is being sorted.
                    if (e.Column == lvcs.SortColumn)
                    {
                        // Reverse the current sort direction for this column.
                        if (lvcs.Order == SortOrder.Ascending)
                        {
                            lvcs.Order = SortOrder.Descending;
                        }
                        else
                        {
                            lvcs.Order = SortOrder.Ascending;
                        }
                    }
                    else
                    {
                        // Set the column number that is to be sorted; default to ascending.
                        lvcs.SortColumn = e.Column;
                        lvcs.Order = SortOrder.Ascending;
                    }

                    // Perform the sort with these new sort options.
                    lv.Sort();
                }
            }
        }
Пример #22
0
        //----------------------------------
        // Organizing tasks by column
        //----------------------------------
        private void LstMision_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
        {
            ListViewColumnSort oCompare = new ListViewColumnSort();

            if (LstMision.Sorting == SortOrder.Ascending)
            {
                oCompare.Sorting = SortOrder.Descending;
            }
            else
            {
                oCompare.Sorting = SortOrder.Ascending;
            }
            LstMision.Sorting    = oCompare.Sorting;
            oCompare.ColumnIndex = e.Column;

            switch (e.Column)
            {
            case 1:
                oCompare.CompararPor = ListViewColumnSort.TipoCompare.Cadena;
                break;

            case 2:
                oCompare.CompararPor = ListViewColumnSort.TipoCompare.Numero;
                break;

            case 3:
                oCompare.CompararPor = ListViewColumnSort.TipoCompare.Numero;
                break;

            case 4:
                oCompare.CompararPor = ListViewColumnSort.TipoCompare.Numero;
                break;

            case 5:
                oCompare.CompararPor = ListViewColumnSort.TipoCompare.Numero;
                break;

            case 6:
                oCompare.CompararPor = ListViewColumnSort.TipoCompare.Numero;
                break;

            case 7:
                oCompare.CompararPor = ListViewColumnSort.TipoCompare.Numero;
                break;

            case 8:
                oCompare.CompararPor = ListViewColumnSort.TipoCompare.Numero;
                break;

            case 9:
                oCompare.CompararPor = ListViewColumnSort.TipoCompare.Numero;
                break;

            case 10:
                oCompare.CompararPor = ListViewColumnSort.TipoCompare.Numero;
                break;
            }
            LstMision.ListViewItemSorter = oCompare;
        }
Пример #23
0
 private void m_lsv_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
 {
     // Set the ListViewItemSorter property to a new ListViewItemComparer object.
     this.m_lsv.ListViewItemSorter = new ListViewItemComparer(e.Column, IsAsc, this.m_lsv);
     IsAsc = !IsAsc;
     // Call the sort method to manually sort the column based on the ListViewItemComparer implementation.
     this.m_lsv.Sort();
 }
Пример #24
0
 private void ListViewHistory_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
 {
     m_sortReverse = (e.Column == m_sortColumn) ? !m_sortReverse : false;
     m_sortColumn  = e.Column;
     m_lvHistory.ListViewItemSorter = this;
     m_lvHistory.Sort();
     m_lvHistory.ListViewItemSorter = null;
 }
Пример #25
0
 private void classListBox_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     if (e.Column == 0)
         aClass.SortClasses("class_no");
     else if (e.Column == 1)
         aClass.SortClasses("name");
     PopulateClassList();
 }
Пример #26
0
 private void irqs_details_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     if (irqsSorter == null)
     {
         irqsSorter = new ListViewSorter(irqs_details);
     }
     irqsSorter.Sort(e.Column);
 }
Пример #27
0
 private void driver_details_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     if (driverSorter == null)
     {
         driverSorter = new ListViewSorter(driver_details);
     }
     driverSorter.Sort(e.Column);
 }
Пример #28
0
        private void ListHeader_Click(object sender, ColumnClickEventArgs e)
        {
            bool isFieldComparer = _listView.ListViewItemSorter as FieldComparer != null;
            bool currSortAsc = isFieldComparer && ((FieldComparer)_listView.ListViewItemSorter).Ascending;
            int currSortIx = isFieldComparer ? ((FieldComparer)_listView.ListViewItemSorter).ColumnIndex : -1;

            _listView.ListViewItemSorter = new FieldComparer(e.Column, currSortIx != e.Column || !currSortAsc);
        }
Пример #29
0
        private void ListViewColumnClick(object sender, ColumnClickEventArgs e)
        {
            var lv = (ListView)sender;

            lv.Sorting = lv.Sorting == SortOrder.Ascending ? SortOrder.Descending : SortOrder.Ascending;

            lv.ListViewItemSorter = new ListViewItemComparer(e.Column, lv.Sorting);
        }
Пример #30
0
 private void processes_details_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     if (processesSorter == null)
     {
         processesSorter = new ListViewSorter(processes_details);
     }
     processesSorter.Sort(e.Column);
 }
Пример #31
0
 private void SortJobs(object sender, ColumnClickEventArgs e)
 {
     int column = e.Column;
     if (!this.sortableColumnIndexs.All<int>(i => (i != column)))
     {
         this.Sort(column);
     }
 }
Пример #32
0
 private void classListBox_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     if (e.Column == 0)
         ActiveResults.SortClasses(ClassSort.Number);
     else if (e.Column == 1)
         ActiveResults.SortClasses(ClassSort.Name);
     PopulateClassList();
 }
Пример #33
0
 private void logs_details_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     if (logsSorter == null)
     {
         logsSorter = new ListViewSorter(logs_details);
     }
     logsSorter.Sort(e.Column);
 }
Пример #34
0
 private void OnColumnClick(object obj, SWF.ColumnClickEventArgs args)
 {
     if (args.Column
         == itemProvider.HeaderProvider.ListView.Columns.IndexOf(itemProvider.ColumnHeader))
     {
         RaiseAutomationEvent();
     }
 }
Пример #35
0
        private void MyBase_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
        {
            ListViewOrderedColumns.ColumnSortOrderInfo colSOI = lstVwOC.ManageColumnToSort(this.Columns[e.Column]);
            RefreshColumnIcon(colSOI);
            MyColumnClickEventArgs args = new MyColumnClickEventArgs(lstVwOC.GetOrder());

            this.OnMyColumnClick(args);
        }
Пример #36
0
        private void lstVendas_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            if (comparadorVenda.Coluna == e.Column)
                lstVendas.Sorting = lstConsignado.Sorting == SortOrder.Ascending ? SortOrder.Descending : SortOrder.Ascending;
            else
                comparadorVenda.Coluna = e.Column;

            lstVendas.Sort();
        }
Пример #37
0
                protected override void OnColumnClick(System.Windows.Forms.ColumnClickEventArgs e)
                {
                    base.OnColumnClick(e);

                    if (EnableSort == true)
                    {
                        SortColumn(e.Column);
                    }
                }
Пример #38
0
 /// <summary>
 /// Sort by Column
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void listList_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
 {
     if (((ListView)sender).ListViewItemSorter == null)
     {
         ((ListView)sender).ListViewItemSorter = sorter;
     }
     sorter.CurrentColumn = e.Column;
     ((ListView)sender).Sort();
 }
Пример #39
0
        private void ExplorerListView_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
        {
            System.Diagnostics.Trace.WriteLine(">>> de.coe.controls.filecontrols.ExplorerListView.ExplorerListView_ColumnClick");
            ExplorerColumnHeader soCH = ((ExplorerColumnHeader)(this.Columns[e.Column]));

            ExpFileSorter.SortCriteria = soCH.SortCriteria;
            this.Sort();
            System.Diagnostics.Trace.WriteLine("<<< de.coe.controls.filecontrols.ExplorerListView.ExplorerListView_ColumnClick");
        }
Пример #40
0
        protected override void OnColumnClick(ColumnClickEventArgs e)
        {
            var comp = new ListViewItemComparer(e.Column);
            if (_lastColumnIndex == e.Column) comp.order = Order.Desc;
            this.ListViewItemSorter = comp;

            _lastColumnIndex = e.Column;
            this.Sort();
            base.OnColumnClick(e);
        }
Пример #41
0
		public void CtorTest ()
		{
			ColumnClickEventArgs ce;

			ce = new ColumnClickEventArgs (0);
			Assert.AreEqual (0, ce.Column, "1");

			ce = new ColumnClickEventArgs (-1);
			Assert.AreEqual (-1, ce.Column, "2");
		}
Пример #42
0
        static private void onColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
        {
            ListView _list = (ListView)sender;
            //ColumnHeader header = _list.Columns[e.Column];
            Sorter sorter = (Sorter)_list.ListViewItemSorter;

            sorter.index    = e.Column;
            sorter.bNumeric = (e.Column > 2);
            _list.Sort();
        }
Пример #43
0
 private void entryListBox_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     if (e.Column == 0)
         ActiveResults.SortEntries("b.back_no");
     else if (e.Column == 1)
         ActiveResults.SortEntries("r.last_name");
     else if (e.Column == 2)
         ActiveResults.SortEntries("h.name");
     PopulateEntryList();
 }
Пример #44
0
 private void listView1_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
 {
     if (listView1.Sorting == SortOrder.Ascending)
     {
         listView1.Sorting = SortOrder.Descending;
     }
     else
     {
         listView1.Sorting = SortOrder.Ascending;
     }
 }
Пример #45
0
 private void lst_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
 {
     if ((lst.ListViewItemSorter as InternalComparer).Column == e.Column)
     {
         lst.ListViewItemSorter = new InternalComparer(e.Column, !(lst.ListViewItemSorter as InternalComparer).Ascending);
     }
     else
     {
         lst.ListViewItemSorter = new InternalComparer(e.Column);
     }
 }
Пример #46
0
 private void OnSkillColClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
 {
     if (e.Column == RazorEnhanced.Settings.General.ReadInt("SkillListCol"))
     {
         RazorEnhanced.Settings.General.WriteBool("SkillListAsc", !RazorEnhanced.Settings.General.ReadBool("SkillListAsc"));
     }
     else
     {
         RazorEnhanced.Settings.General.WriteInt("SkillListCol", e.Column);
     }
     SortSkills();
 }
Пример #47
0
 private void m_lvCotacoes_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
 {
     m_nIdColunaSelecionada = e.Column;
     if (m_lvCotacoes.Sorting == System.Windows.Forms.SortOrder.Ascending)
     {
         m_lvCotacoes.Sorting = System.Windows.Forms.SortOrder.Descending;
     }
     else
     {
         m_lvCotacoes.Sorting = System.Windows.Forms.SortOrder.Ascending;
     }
     OnCallOrdenaItens();
 }
Пример #48
0
 private void list_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
 {
     if (e.Column == sortColumn)
     {
         sorting *= -1;
     }
     else
     {
         sortColumn = e.Column;
         sorting    = (sortColumn == 0 ? 1 : -1);
     }
     list.Sort();
 }
Пример #49
0
        // Column Click
        private void gamelist_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
        {
            switch (e.Column)
            {
            case 0: sortName_Click(sender, EventArgs.Empty); break;

            case 1: sortGenre_Click(sender, EventArgs.Empty); break;

            case 2: sortDev_Click(sender, EventArgs.Empty); break;

            case 3: sortPub_Click(sender, EventArgs.Empty); break;
            }
        }
        private void LVwReceivedPackets_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
        {
            int ClickedColumn = e.Column;

            switch (ClickedColumn)
            {
            case 0:
                TheColumnSorter.CaseSensitivity = true;
                TheColumnSorter.Direction       = TheColumnSorter.Direction == 0 ? 1 : 0;
                TheColumnSorter.ColumnType      = 0;
                TheColumnSorter.CurrentColumn   = 0;
                break;

            case 1:
                TheColumnSorter.CaseSensitivity = true;
                TheColumnSorter.Direction       = TheColumnSorter.Direction == 0 ? 1 : 0;
                TheColumnSorter.ColumnType      = 1;
                TheColumnSorter.CurrentColumn   = 1;
                break;

            case 2:
                TheColumnSorter.CaseSensitivity = true;
                TheColumnSorter.Direction       = TheColumnSorter.Direction == 0 ? 1 : 0;
                TheColumnSorter.ColumnType      = 2;
                TheColumnSorter.CurrentColumn   = 2;
                break;

            case 3:
                TheColumnSorter.CaseSensitivity = true;
                TheColumnSorter.Direction       = TheColumnSorter.Direction == 0 ? 1 : 0;
                TheColumnSorter.ColumnType      = 2;
                TheColumnSorter.CurrentColumn   = 3;
                break;

            case 4:
                TheColumnSorter.CaseSensitivity = true;
                TheColumnSorter.Direction       = TheColumnSorter.Direction == 0 ? 1 : 0;
                TheColumnSorter.ColumnType      = 2;
                TheColumnSorter.CurrentColumn   = 4;
                break;

            case 5:
                TheColumnSorter.CaseSensitivity = true;
                TheColumnSorter.Direction       = TheColumnSorter.Direction == 0 ? 1 : 0;
                TheColumnSorter.ColumnType      = 2;
                TheColumnSorter.CurrentColumn   = 5;
                break;
            }

            LVwReceivedPackets.Sort();
        }
        // Sort ListView
        private void listViewEmbeddedControls1_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
        {
            switch (listViewEmbeddedControls1.Sorting)
            {
            case SortOrder.None:
            case SortOrder.Ascending:
                listViewEmbeddedControls1.Sorting = SortOrder.Descending;
                break;

            case SortOrder.Descending:
                listViewEmbeddedControls1.Sorting = SortOrder.Ascending;
                break;
            }
        }
Пример #52
0
        private void lsv_Tasks_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
        {
            switch (this.lsv_Tasks.Sorting)
            {
            case System.Windows.Forms.SortOrder.Ascending: this.lsv_Tasks.Sorting = System.Windows.Forms.SortOrder.Descending; break;

            case System.Windows.Forms.SortOrder.Descending: this.lsv_Tasks.Sorting = System.Windows.Forms.SortOrder.Ascending; break;

            default: this.lsv_Tasks.Sorting = SortOrder.Descending; break;
            }

            this.lsv_Tasks.ListViewItemSorter = new ListViewItemComparer(e.Column, this.lsv_Tasks.Sorting);
            this.lsv_Tasks.Sort();
        }
Пример #53
0
 private void listView_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
 {
     if (this.listView.Columns.Count <= e.Column)
     {
         return;
     }
     if (this.sortColumn != e.Column)
     {
         this.ClearSortMode();
     }
     this.sortColumn = e.Column;
     this.isAssent   = !this.isAssent;
     this.listView.ListViewItemSorter = new ListViewItemComparer(this, e.Column, this.isAssent);
     this.listView.ListViewItemSorter = null;
 }
Пример #54
0
        private void ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
        {
            ListView  LV   = (ListView)sender;
            Hashtable ht   = GetHashtable(LV);
            bool      sort = false;;

            if (ht[e.Column] == null)
            {
                ht[e.Column] = sort;
            }
            ht[e.Column]          = !(bool)ht[e.Column];
            sort                  = (bool)ht[e.Column];
            LV.ListViewItemSorter = new ListViewItemComparer(e.Column, sort);
            LV.Sort();
        }
Пример #55
0
 private void listView1_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
 {
     /*
      * this.listView1.ListViewItemSorter = new ListViewItemComparer(e.Column, listView1.Sorting);
      * listView1.Sort();
      * if (listView1.Sorting == SortOrder.Ascending)
      * {
      *  listView1.Sorting = SortOrder.Descending;
      * }
      * else
      * {
      *  listView1.Sorting = SortOrder.Ascending;
      * }
      */
 }
Пример #56
0
        private void ViewMain_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
        {
            if (ViewMain.SelectedItems.Count == 0)
            {
                if (ViewMain.Sorting == SortOrder.Ascending)
                {
                    ViewMain.Sorting = SortOrder.Descending;
                }
                else
                {
                    ViewMain.Sorting = SortOrder.Ascending;
                }
            }

            this.ViewMain.ListViewItemSorter = new SortView(e.Column);
        }
Пример #57
0
 private void m_lvPEs_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
 {
     try
     {
         if (m_lvPEs.Sorting == System.Windows.Forms.SortOrder.Ascending)
         {
             m_lvPEs.Sorting = System.Windows.Forms.SortOrder.Descending;
         }
         else
         {
             m_lvPEs.Sorting = System.Windows.Forms.SortOrder.Ascending;
         }
     }catch (System.Exception eExcp) {
         m_cls_ter_tratadorErro.trataErro(ref eExcp);
     }
 }
Пример #58
0
        private void m_lvwPlan_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
        {
            bool IsAsc = false;          //是否为升序

            if (m_lvwPlan.Sorting == SortOrder.Ascending)
            {
                m_lvwPlan.Sorting = SortOrder.Descending;
            }
            else
            {
                m_lvwPlan.Sorting = SortOrder.Ascending;
                IsAsc             = true;
            }
            m_lvwPlan.ListViewItemSorter = new ListViewItemComparer(e.Column, IsAsc, m_lvwPlan);
            m_lvwPlan.Sort();
        }
Пример #59
0
        private void OnColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
        {
            if (!sortable)
            {
                return;
            }

            LastSortedColumn = e.Column;
            RowSorterHelper rs = this.GetRowSorterHelper();

            if (rs == null)
            {
                this.ListViewItemSorter = new StringComparer(this);
            }
            else if (rs.Format == SortedListViewFormatType.String)
            {
                this.ListViewItemSorter = new StringComparer(this);
            }
            else if (rs.Format == SortedListViewFormatType.Numeric)
            {
                this.ListViewItemSorter = new NumericComparer(this);
            }
            else if (rs.Format == SortedListViewFormatType.Date)
            {
                this.ListViewItemSorter = new DateTimeComparer(this);
            }
            else if (rs.Format == SortedListViewFormatType.Custom)
            {
                if (this.CustomCompare != null)
                {
                    this.CustomCompare(this);
                    return;
                }
            }
            this.Sort();

            this.ListViewItemSorter = null;

            if (this.SortingOrder == SortOrder.Descending)
            {
                this.SortingOrder = SortOrder.Ascending;
            }
            else
            {
                this.SortingOrder = SortOrder.Descending;
            }
        }
Пример #60
0
        /// <summary>
        /// Handler for the ColumnClick event.
        /// </summary>
        /// <param name="sender">The SortListView control that sent the event</param>
        /// <param name="e">A ColumnClickEventArgs that contains the event data</param>
        /// <remarks>
        /// The OnColumnClick event is fired when a user clicks a column header.
        /// </remarks>
        private void OnColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
        {
            Debug.Assert(sender.GetType() == typeof(SortListView), "sender.GetType() != typeof(SortListView)");

            if (sender.GetType() == typeof(SortListView))
            {
                SortOrder sortOrder = SortOrder.None;
                if (e.Column == SortColumn)
                {
                    // Clicked on column that currently has sort arrow, so flip the state.
                    if (Sorting == SortOrder.Ascending)
                    {
                        sortOrder = SortOrder.Descending;
                    }
                    else
                    {
                        sortOrder = SortOrder.Ascending;
                    }

                    SortColumn = e.Column;
                }
                else
                {
                    // This changes the Sorting property to point to the new column.
                    SortColumn = e.Column;

                    if (Sorting == SortOrder.None)
                    {
                        // Default to ascending sort order.
                        sortOrder = SortOrder.Ascending;
                    }
                    else
                    {
                        // Use existing sort order.
                        sortOrder = Sorting;
                    }
                }

                // This will execute the sort.
                Sorting = sortOrder;
            }
            else
            {
                throw new ArgumentException("Invalid sender");
            }
        }