//Populate Helper Tasks------------------------------------------------------------------------------------------ private void loadActiveWORs() { dgActiveWORs.Enabled = false; //Get Current Selection Location if (dgActiveWORs.CurrentCell != null) { if (dgActiveWORs.CurrentCell.ColumnIndex > 0) { WORactiveRow = dgActiveWORs.CurrentCell.RowIndex; WORactiveColumn = dgActiveWORs.CurrentCell.ColumnIndex; } } //Load DataGridView Classes.DataAccess.DashboardDataAccess db = new Classes.DataAccess.DashboardDataAccess(); engineeringDashboard = db.LoadDashboard(ckQuotes.Checked, ckWORs.Checked); dgActiveWORs.DataSource = engineeringDashboard; Classes.StatusCalculation calculatedStatus = new Classes.StatusCalculation(); calculatedStatus.CalculateDashboard(engineeringDashboard); //Format DataGridView formatDataGrid(); //Re-select Current Cell try { dgActiveWORs.CurrentCell = dgActiveWORs.Rows[WORactiveRow].Cells[WORactiveColumn]; } catch { } dgActiveWORs.Enabled = true; }
public void populate(object sender, EventArgs e) { dgActiveWORs.Enabled = false; //Get Current Selection Location if (dgActiveWORs.CurrentCell != null) { if (dgActiveWORs.CurrentCell.ColumnIndex > 0) { WORactiveRow = dgActiveWORs.CurrentCell.RowIndex; WORactiveColumn = dgActiveWORs.CurrentCell.ColumnIndex; } } //Load DataGridView Classes.DataAccess.DashboardDataAccess db = new Classes.DataAccess.DashboardDataAccess(); purchasingDashboard = db.LoadDashboard(ckQuotes.Checked, ckWORs.Checked); dgActiveWORs.DataSource = purchasingDashboard; Classes.StatusCalculation calculatedStatus = new Classes.StatusCalculation(); calculatedStatus.CalculateDashboard(purchasingDashboard); //Format DataGridView formatDataGrid(); //Re-set Current Cell try { dgActiveWORs.CurrentCell = dgActiveWORs.Rows[WORactiveRow].Cells[WORactiveColumn]; } catch { } dgActiveWORs.Enabled = true; //Task View Stuff dgTaskView.Enabled = false; //Get Current Selection Location if (dgTaskView.CurrentCell != null) { if (dgTaskView.CurrentCell.ColumnIndex > 0) { TaskActiveRow = dgTaskView.CurrentCell.RowIndex; TaskActiveColumn = dgTaskView.CurrentCell.ColumnIndex; } } Classes.DataAccess.PurchasingDataAccess dbPur = new Classes.DataAccess.PurchasingDataAccess(); TaskRequests = dbPur.GetPurchasingTaskList(); dgTaskView.DataSource = TaskRequests; //Format Task View Data Grid dgTaskView.Columns["Owner"].Visible = false; dgTaskView.Columns["SuperHot"].Visible = false; //Re-Select Current Cell try { dgTaskView.CurrentCell = dgTaskView.Rows[TaskActiveRow].Cells[TaskActiveColumn]; } catch { } dgTaskView.Enabled = true; dgTaskView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; dgTaskView.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; }