public static void SuspendDataGridViews() { WorkTables.SetSheetDataGridViewFocus(); System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor; SuspendDataGridViewDrawing(); void SuspendDataGridViewDrawing() { NAVForm.SuspendSheetDataGridView(); ExplorerForm.SuspendResultDataGridView(); } }
private void DeleteColumnMenuItemClick(object sender, System.EventArgs e) { if (SheetDataGridView.CurrentCell != null) { DataGridViewColumn FirstVisibleColumn = SheetDataGridView.Columns.GetFirstColumn(DataGridViewElementStates.Visible); int iFirstColumnIndex = FirstVisibleColumn.DisplayIndex; int iOwningColumnIndex = SheetDataGridView.CurrentCell.OwningColumn.Index; SheetDataGridView.ClearSelection(); SheetDataGridView.Columns[iOwningColumnIndex].Visible = false; if (iFirstColumnIndex == iOwningColumnIndex) { ClassLibraryFramework.DataGridViewMethods.SortOnFirstVisibleColumn(SheetDataGridView); } WorkTables.SetSheetDataGridViewFocus(); ComparisonReset(); } }
private static void RestoreColumnMenuItemClickEvent() { DataGridViewColumn firstVisibleColumn = SheetDataGridView.Columns.GetFirstColumn(DataGridViewElementStates.Visible); bool bComparisonRebuild = false; foreach (DataGridViewColumn column in SheetDataGridView.Columns) { if (column.Name != Constants.KEY_COLUMN) { if (!column.Visible) { column.Visible = true; bComparisonRebuild = true; } } } if (bComparisonRebuild) { if (firstVisibleColumn != SheetDataGridView.Columns.GetFirstColumn(DataGridViewElementStates.Visible)) { ClassLibraryFramework.DataGridViewMethods.SortOnFirstVisibleColumn(SheetDataGridView); } ComparisonReset(); } if (ExplorerForm.GetResultDataGridView() != null) { if (ExplorerForm.GetResultDataGridView().Rows.Count == 0) { ClassLibraryFramework.DataGridViewMethods.SetBackgroundColour(SheetDataGridView, Constants.COLOR_DEFAULT); } } WorkTables.SetSheetDataGridViewFocus(); }