ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

C1DisplayColumn.ClearCellStyle Method

Removes a cell condition established with a previous call to the AddCellStyle method.

[Visual Basic]

Public Sub ClearCellStyle( _

ByVal condition As CellStyleFlag _

)

[C#]

public void ClearCellStyle(

CellStyleFlag condition

);

[Delphi]

public procedure ClearCellStyle(

condition: CellStyleFlag

);

Parameters

condition

Combination of one or more CellStyleFlag enumerations.

Example

The following code uses the ClearCellStyle method to clear the cell condition established with a previous call to the AddCellStyle method:

·      Visual Basic

       Private Sub ShowStylesBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShowStylesBtn.Click

           Dim S As C1.Win.C1TrueDBGrid.Style = New C1.Win.C1TrueDBGrid.Style

           S.BackColor = System.Drawing.Color.Yellow

           Me.C1TrueDBGrid1.AddCellStyle(C1.Win.C1TrueDBGrid.CellStyleFlag.CurrentCell, S)

           Dim S2 As C1.Win.C1TrueDBGrid.Style = New C1.Win.C1TrueDBGrid.Style

           S2.ForeColor = System.Drawing.Color.Red

           Me.C1TrueDBGrid1.AddCellStyle(C1.Win.C1TrueDBGrid.CellStyleFlag.UpdatedCell, S2)

       End Sub

       Private Sub ClearCellStyle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearCellStyle.Click

           Me.C1TrueDBGrid1.ClearCellStyle(C1.Win.C1TrueDBGrid.CellStyleFlag.AllCells)

       End Sub

·      C#

       private void ShowStylesBtn_Click(object sender, EventArgs e)

       {

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

           S.BackColor = System.Drawing.Color.Yellow;

           this.c1TrueDBGrid1.AddCellStyle(C1.Win.C1TrueDBGrid.CellStyleFlag.CurrentCell, S);

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

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

           this.c1TrueDBGrid1.AddCellStyle(C1.Win.C1TrueDBGrid.CellStyleFlag.UpdatedCell, S2);

       }

       private void ClearStylesBtn_Click(object sender, EventArgs e)

       {

            this.c1TrueDBGrid1.ClearCellStyle(C1.Win.C1TrueDBGrid.CellStyleFlag.AllCells);

       }

·      Delphi

       procedure ShowStylesBtn_Click(sender: System.Object; e: System.EventArgs);

       var

         S: C1.Win.C1TrueDBGrid.Style;

         S2: C1.Win.C1TrueDBGrid.Style;

       begin

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

         S.BackColor := System.Drawing.Color.Yellow;

         Self.C1TrueDBGrid1.AddCellStyle(C1.Win.C1TrueDBGrid.CellStyleFlag.CurrentCell, S);

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

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

         Self.C1TrueDBGrid1.AddCellStyle(C1.Win.C1TrueDBGrid.CellStyleFlag.UpdatedCell, S2);

       end;

       procedure ClearStylesBtn_Click(sender: System.Object; e: System.EventArgs);

       begin

         Self.C1TrueDBGrid1.ClearCellStyle(C1.Win.C1TrueDBGrid.CellStyleFlag.AllCells);

       end;

See Also

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


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