BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e) { GridTableCellStyleInfo style = (GridTableCellStyleInfo) e.Style; if (style.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell || style.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell) { GridColumnDescriptor column = style.TableCellIdentity.Column; if (column.TableDescriptor.Columns.IndexOf(column) == 0) { e.Style.BackColor = Color.Red; e.Style.ReadOnly = true; } } }
private void gridGroupingControl1_TableControlPrepareViewStyleInfo(object sender, GridTableControlPrepareViewStyleInfoEventArgs e) { GridTableCellStyleInfo tableCellStyle = e.Inner.Style as GridTableCellStyleInfo;//e.TableControl.Model[e.Inner.RowIndex, e.Inner.ColIndex]; GridTableCellStyleInfoIdentity tableCellInfo = tableCellStyle.TableCellIdentity; if(tableCellInfo.Column != null && tableCellInfo.Column.MappingName == Constants.DataBase.col_ETVT_Custom) { if(tableCellInfo.TableCellType == GridTableCellType.AlternateRecordFieldCell || tableCellInfo.TableCellType == GridTableCellType.RecordFieldCell) { GridRecord rec = (tableCellInfo.DisplayElement as GridRecordRow).ParentRecord; bool b = (rec.GetValue(Constants.DataBase.col_ETVTmanuell) == DBNull.Value) ? false : Convert.ToBoolean(rec.GetValue(Constants.DataBase.col_ETVTmanuell)); if(Convert.ToBoolean(b)) e.Inner.Style.BackColor = Color.PaleGreen; } } }