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"); } }
/* 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"); } }
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(); } } }
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")); } }
private void SortButton_Click(object sender, EventArgs e) { this.CatalogGridView.CurrentCell = null; if (this.sortStatement.Text != "") { m_bluePrintsView.ApplySort(this.sortStatement.Text); } }
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; }
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); }
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(); } } }