Example #1
0
        private void ordenaListViewItens(ref mdlComponentesGraficos.ListView lvCotacoes)
        {
            try
            {
                switch (lvCotacoes.View)
                {
                case (System.Windows.Forms.View.Details):
                    m_clsSorter.COLUNA           = m_formFCotacoes.m_nIdColunaSelecionada;
                    m_clsDescendingSorter.COLUNA = m_formFCotacoes.m_nIdColunaSelecionada;
                    break;

                default:
                    m_clsSorter.COLUNA           = 0;
                    m_clsDescendingSorter.COLUNA = 0;
                    break;
                }
                if (lvCotacoes.Sorting == System.Windows.Forms.SortOrder.Descending)
                {
                    lvCotacoes.ListViewItemSorter = m_clsDescendingSorter;
                }
                else
                {
                    lvCotacoes.ListViewItemSorter = m_clsSorter;
                }
                lvCotacoes.Sort();
            }
            catch (Exception err)
            {
                m_cls_ter_tratadorErro.trataErro(ref err);
            }
        }
Example #2
0
 private void m_lvContratos_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
 {
     mdlComponentesColecoes.clsComparerListViewItem objComp = new mdlComponentesColecoes.clsComparerListViewItem(e.Column);
     if (m_nColumn == e.Column)
     {
         if (m_lvContratos.Sorting == System.Windows.Forms.SortOrder.Descending)
         {
             objComp.OrderCrescent = true;
             m_lvContratos.Sorting = System.Windows.Forms.SortOrder.Ascending;
         }
         else
         {
             objComp.OrderCrescent = false;
             m_lvContratos.Sorting = System.Windows.Forms.SortOrder.Descending;
         }
     }
     else
     {
         m_nColumn = e.Column;
     }
     m_lvContratos.ListViewItemSorter = objComp;
     m_lvContratos.Sort();
 }