public void setDisabledColandRows(DataGridView dgv, DataTable dt) { //reset the column disabled properties foreach (DataColumn c in dt.Columns) { bool hasattribute = c.ExtendedProperties.ContainsKey(VBCommon.Globals.ENABLED); if (hasattribute) { int selectedColIndex = dt.Columns.IndexOf(c); if (c.ExtendedProperties[VBCommon.Globals.ENABLED].ToString() != "True") { for (int r = 0; r < dgv.Rows.Count; r++) { dgv[selectedColIndex, r].Style.ForeColor = Color.Red; } } } } //reset disable rows _dtRI = dtRowInformation.getdtRI(dt, false); for (int r = 0; r < dt.Rows.Count; r++) { bool enabled = _dtRI.getRowStatus(dt.Rows[r][0].ToString()); if (!enabled) { for (int c = 0; c < dgv.Columns.Count; c++) { dgv[c, r].Style.ForeColor = Color.Red; } } } }
public void enableGridCol(DataGridView dgv, int selectedColIndex, DataTable dt) { dtRowInformation dtRI = dtRowInformation.getdtRI(dt, false); for (int r = 0; r < dgv.Rows.Count; r++) { //set style to black unless the row is disabled if (!dtRI.getRowStatus(dgv[0, r].Value.ToString())) { continue; } dgv[selectedColIndex, r].Style.ForeColor = Color.Black; } }
public void maintainGrid(DataGridView dgv, DataTable dt, int selectedColIndex, string responseVarColName) { //reset the grid dgv.DataSource = null; dgv.DataSource = dt; //mark all grid cols visible, not sortable for (int c = 0; c < dgv.Columns.Count; c++) { dgv.Columns[c].SortMode = DataGridViewColumnSortMode.NotSortable; } //hide any main effect cols that have been transformed (hidden attribute is set in the transform class) foreach (DataColumn c in dt.Columns) { bool hashidden = c.ExtendedProperties.ContainsKey(VBCommon.Globals.HIDDEN); if (hashidden == true) { if (c.ExtendedProperties[VBCommon.Globals.HIDDEN].ToString() == "True") { dgv.Columns[c.ColumnName].Visible = false; } } //reset the column disabled properties bool hasattribute = c.ExtendedProperties.ContainsKey(VBCommon.Globals.ENABLED); if (hasattribute) { selectedColIndex = dt.Columns.IndexOf(c); if (c.ExtendedProperties[VBCommon.Globals.ENABLED].ToString() != "True") { for (int r = 0; r < dgv.Rows.Count; r++) dgv[selectedColIndex, r].Style.ForeColor = Color.Red; } else { for (int r = 0; r < dgv.Rows.Count; r++) dgv[selectedColIndex, r].Style.ForeColor = Color.Black; } } } //reset the UI clues for the response variable dgv.Columns[responseVarColName].DefaultCellStyle.BackColor = Color.LightBlue; //reset disable rows _dtRI = dtRowInformation.getdtRI(dt, false); for (int r = 0; r < dt.Rows.Count; r++) { bool enabled = _dtRI.getRowStatus(dt.Rows[r][0].ToString()); if (!enabled) { for (int c = 0; c < dgv.Columns.Count; c++) dgv[c, r].Style.ForeColor = Color.Red; } } //set the numerical precision for display setViewOnGrid(dgv); }
public void maintainGrid(DataGridView dgv, DataTable dt, int selectedColIndex, string responseVarColName) { //reset the grid dgv.DataSource = null; dgv.DataSource = dt; //mark all grid cols visible, not sortable for (int c = 0; c < dgv.Columns.Count; c++) { dgv.Columns[c].SortMode = DataGridViewColumnSortMode.NotSortable; } //hide any main effect cols that have been transformed (hidden attribute is set in the transform class) foreach (DataColumn c in dt.Columns) { bool hashidden = c.ExtendedProperties.ContainsKey(VBCommon.Globals.HIDDEN); if (hashidden == true) { if (c.ExtendedProperties[VBCommon.Globals.HIDDEN].ToString() == "True") { dgv.Columns[c.ColumnName].Visible = false; } } //reset the column disabled properties bool hasattribute = c.ExtendedProperties.ContainsKey(VBCommon.Globals.ENABLED); if (hasattribute) { selectedColIndex = dt.Columns.IndexOf(c); if (c.ExtendedProperties[VBCommon.Globals.ENABLED].ToString() != "True") { for (int r = 0; r < dgv.Rows.Count; r++) { dgv[selectedColIndex, r].Style.ForeColor = Color.Red; } } else { for (int r = 0; r < dgv.Rows.Count; r++) { dgv[selectedColIndex, r].Style.ForeColor = Color.Black; } } } } //reset the UI clues for the response variable dgv.Columns[responseVarColName].DefaultCellStyle.BackColor = Color.LightBlue; //reset disable rows _dtRI = dtRowInformation.getdtRI(dt, false); for (int r = 0; r < dt.Rows.Count; r++) { bool enabled = _dtRI.getRowStatus(dt.Rows[r][0].ToString()); if (!enabled) { for (int c = 0; c < dgv.Columns.Count; c++) { dgv[c, r].Style.ForeColor = Color.Red; } } } //set the numerical precision for display setViewOnGrid(dgv); }
public void setDisabledColandRows(DataGridView dgv, DataTable dt) { //reset the column disabled properties foreach (DataColumn c in dt.Columns) { bool hasattribute = c.ExtendedProperties.ContainsKey(VBCommon.Globals.ENABLED); if (hasattribute) { int selectedColIndex = dt.Columns.IndexOf(c); if (c.ExtendedProperties[VBCommon.Globals.ENABLED].ToString() != "True") { for (int r = 0; r < dgv.Rows.Count; r++) dgv[selectedColIndex, r].Style.ForeColor = Color.Red; } } } //reset disable rows _dtRI = dtRowInformation.getdtRI(dt, false); for (int r = 0; r < dt.Rows.Count; r++) { bool enabled = _dtRI.getRowStatus(dt.Rows[r][0].ToString()); if (!enabled) { for (int c = 0; c < dgv.Columns.Count; c++) dgv[c, r].Style.ForeColor = Color.Red; } } }