ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

C1TrueDBGrid.AddCellStyle Method

Controls the Style used to change the appearance for cells meeting the specified condition.

[Visual Basic]

Public Sub AddCellStyle( _

ByVal condition As CellStyleFlag, _

ByVal style As C1.Win.C1TrueDBGrid.Style _

)

[C#]

public void AddCellStyle(

CellStyleFlag condition,

C1.Win.C1TrueDBGrid.Style style

);

[Delphi]

public procedure AddCellStyle(

condition: CellStyleFlag;

style: C1.Win.C1TrueDBGrid.Style

);

Parameters

condition

Combination of one or more CellStyleFlag enumerations.

style

Style object that specifies appearance attributes.

Remarks

Each time the AddCellStyle method is invoked, the specified cell condition is added to the list of existing conditions. Hence, by repeated use of this method it is possible to set up multiple conditions to affect the appearance of a grid, column, or split.

Note: If a cell condition already exists for a particular condition value, the new style setting replaces the existing one.

Example

The following code causes updated cells to be displayed in red:

·      Visual Basic

       Dim S As New C1.Win.C1TrueDBGrid.Style()

       S.ForeColor = System.Drawing.Color.Red

       Me.C1TrueDBGrid1.AddCellStyle C1.Win.C1TrueDBGRid.CellStyleFlag.UpdatedCell, S

·      C#

       C1.Win.C1TrueDBGrid.Style  S = new C1.Win.C1TrueDBGrid.Style();

       S.ForeColor = System.Drawing.Color.Red;

       this.c1TrueDBGrid1.AddCellStyle C1.Win.C1TrueDBGRid.CellStyleFlag.UpdatedCell, S;

·      Delphi

       var S: C1.Win.C1TrueDBGrid.Style;

       S := C1.Win.C1TrueDBGrid.Style.Create;

       S.ForeColor := System.Drawing.Color.Red;

       Self.C1TrueDBGrid1.AddCellStyle(C1.Win.C1TrueDBGRid.CellStyleFlag.UpdatedCell, S);

See Also

C1TrueDBGrid Class | C1TrueDBGrid Members | C1.Win.C1TrueDBGrid Namespace


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.