コード例 #1
0
 private void cvOrdenar_CheckedChanged(object sender, System.EventArgs e)
 {
     if (!listAlumnosBindingSource.SupportsAdvancedSorting)
     {
         return;
     }
     if (cvOrdenar.Checked == true)
     {
         vista.ApplySort("BecaAlumno DESC, NomAlumno ASC");
     }
     else
     {
         vista.ApplySort("IdAlumno");
     }
 }
コード例 #2
0
        /*   private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
         * {
         *     ObjectView<CTelefono> obVista =
         *                                     bs.Current as ObjectView<CTelefono>;
         *     CTelefono TelefonoActual = obVista.Object;
         *     MessageBox.Show(TelefonoActual._nombre);
         * }*/

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (!bs.SupportsAdvancedSorting)
            {
                return;
            }
            if (checkBox1.Checked == true)
            {
                vista.ApplySort("Nombre ASC");
            }
            else
            {
                vista.ApplySort("Nombre");
            }
        }
コード例 #3
0
 private void dgvMain_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (this.m_datasource != null)
     {
         string             str    = null;
         DataGridViewColumn column = this.dgvMain.Columns[e.ColumnIndex];
         foreach (DataGridViewColumn column2 in this.dgvMain.Columns)
         {
             if (column2 != column)
             {
                 column2.HeaderCell.SortGlyphDirection = SortOrder.None;
             }
         }
         if (column.HeaderCell.SortGlyphDirection == SortOrder.Ascending)
         {
             column.HeaderCell.SortGlyphDirection = SortOrder.Descending;
             str = " ASC";
         }
         else
         {
             column.HeaderCell.SortGlyphDirection = SortOrder.Ascending;
             str = " DESC";
         }
         BindingListView <GameFileDataSource> datasource = this.m_datasource;
         if (datasource != null)
         {
             datasource.ApplySort(column.Name + " " + str);
             this.dgvMain.Invalidate();
         }
     }
 }
コード例 #4
0
 private void SortDataGridView(DataGridViewColumn column)
 {
     if (column.SortMode == DataGridViewColumnSortMode.Automatic)
     {
         notificationsView.ApplySort(string.Format("{0} {1}", column.DataPropertyName, column.HeaderCell.SortGlyphDirection == SortOrder.Ascending ? "ASC" : "DESC"));
     }
 }
コード例 #5
0
 private void SortButton_Click(object sender, EventArgs e)
 {
     this.CatalogGridView.CurrentCell = null;
     if (this.sortStatement.Text != "")
     {
         m_bluePrintsView.ApplySort(this.sortStatement.Text);
     }
 }
コード例 #6
0
 public void Fill(GenerationReportCollection source)
 {
     // Create a view of the items
     _sorted = new BindingListView <GenerationReport>(source);
     _sorted.ApplySort("ObjectName ASC");
     // Make the grid display this view
     generationReportCollectionBindingSource.DataSource = _sorted;
 }
コード例 #7
0
        public string ShowDialogWithResult(IList <NotaDestinada> notasDestinadas)
        {
            if (notasDestinadas != null)
            {
                var listNotasDestinadas = notasDestinadas.ToList();
                ordenacao                     = TypeDescriptor.GetProperties(typeof(NotaDestinada))["Nsu"];
                viewNotasDestinadas           = new BindingListView <NotaDestinada>(listNotasDestinadas);
                dtgNotasDestinadas.DataSource = viewNotasDestinadas;

                viewNotasDestinadas.ApplySort(ordenacao, ListSortDirection.Ascending);
            }

            this.ShowDialog();
            return(result);
        }
コード例 #8
0
        private void HandleSort(int columnIndex, bool flip)
        {
            if (m_datasource != null)
            {
                string sortOrder = null;

                DataGridViewColumn dgvcSet = dgvMain.Columns[columnIndex];

                foreach (DataGridViewColumn dgvc in dgvMain.Columns)
                {
                    if (dgvc != dgvcSet)
                    {
                        dgvc.HeaderCell.SortGlyphDirection = SortOrder.None;
                    }
                }

                if (flip)
                {
                    if (dgvcSet.HeaderCell.SortGlyphDirection == SortOrder.Ascending)
                    {
                        dgvcSet.HeaderCell.SortGlyphDirection = SortOrder.Descending;
                    }
                    else
                    {
                        dgvcSet.HeaderCell.SortGlyphDirection = SortOrder.Ascending;
                    }
                }

                if (dgvcSet.HeaderCell.SortGlyphDirection == SortOrder.Ascending)
                {
                    sortOrder = "ASC";
                }
                else
                {
                    sortOrder = "DESC";
                }

                BindingListView <GameFile> source = m_datasource as BindingListView <GameFile>;

                if (source != null)
                {
                    source.ApplySort(string.Concat(dgvcSet.Name, " ", sortOrder));
                    dgvMain.Invalidate();
                }
            }
        }