ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

Highlighting the Row of the Selected Cell

To highlight the row of the selected cell, set the MarqueeStyle property to HighlightRow. This can be set either in the designer or in code.

In the Designer

1.   Locate the MarqueeStyle property in the Properties window and set it to HighlightRow.

2.   Click the ellipsis button next to the HighlightRowStyle property in the Properties window to open the Style Editor.

3.   On the Contents tab, set the ForeColor to WhiteSmoke.

4.   On the Fill Effects tab, set the BackColor to Navy.

5.   Click Ok to close the Style Editor.

In Code

1.   Set the MarqueeStyle property to HighlightRow by adding the following code to the Form_Load event:

·      Visual Basic

Me.C1TrueDBGrid1.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.HighlightRow

·      C#

this.c1TrueDBGrid1.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.HighlightRow;

·      Delphi

Self.C1TrueDBGrid1.MarqueeStyle := C1.Win.C1TrueDBGrid.MarqueeEnum.HighlightRow;

2.   Set the ForeColor of the highlight to WhiteSmoke:

·      Visual Basic

Me.C1TrueDBGrid1.HighLightRowStyle.ForeColor = Color.WhiteSmoke

·      C#

this.c1TrueDBGrid1.HighLighRowStyle.ForeColor = Color.WhiteSmoke;

·      Delphi

Self.C1TrueDBGrid1.HighLightRowStyle.ForeColor := Color.WhiteSmoke;

3.   Set the BackColor of the highlight to Navy:

·      Visual Basic

Me.C1TrueDBGrid1.HighLightRowStyle.BackColor = Color.Navy

·      C#

this.c1TrueDBGrid1.HighLightRowStyle.BackColor = Color.Navy;

·      Delphi

Self.C1TrueDBGrid1.HighLightRowStyle.BackColor := Color.Navy;

This topic illustrates the following:

When a cell is selected, the entire row will highlight with the text in WhiteSmoke and the highlight in Navy.


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