private void CreateViewsColumns() { var objectCols = FormReplacementHelper.GetDefaultObjectColumnTitles(); StaticMethods.CreateDataGridViewColumn(ObjectView, objectCols); var mayReplCols = FormReplacementHelper.GetDefaultMayReplacementColumnTitles(); StaticMethods.CreateDataGridViewColumn(ObjectMayView, mayReplCols); }
private void SetStyleForActiveRows() { var activedStyle = ObjectView.Rows[0].InheritedStyle.Clone(); activedStyle.BackColor = Color.LightGray; var checkColumns = FormReplacementHelper.GetCheckBoxColumnNames(); SetRowsStyle(ObjectView, activedStyle, "ISNULL(_ActiveObjectId,0)<>0", checkColumns); SetRowsStyle(ObjectMayView, activedStyle, "ISNULL(_PassiveObjectId,0)<>0", checkColumns); }
private void SetDefaultCellStyleForPair(DataGridViewRow dgvRow) { var bs = (BindingSource)ObjectMayView.DataSource; var row = ((DataRowView)dgvRow.DataBoundItem).Row; var indx = bs.Find("ObjectId", row["_ActiveObjectId"]); var checkColumns = FormReplacementHelper.GetCheckBoxColumnNames(); if (indx > -1) { StaticMethods.SetDefaultCellStyleForRow(ObjectMayView.Rows[indx], _defaultStyle, checkColumns); } StaticMethods.SetDefaultCellStyleForRow(dgvRow, _defaultStyle, checkColumns); }