ComponentOne True DBGrid for WinForms
True DBGrid for WinForms Task-Based Help / Setting the Grid's Appearance / Highlighting the Row of the Selected Cell
In This Topic
    Highlighting the Row of the Selected Cell
    In This Topic

    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

    Complete the following steps to highlight the row of the selected cell using 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

    To highlight the row of the selected cell using code, complete the following steps:

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

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Me.C1TrueDBGrid1.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.HighlightRow
      

      To write code in C#

      C#
      Copy Code
      this.c1TrueDBGrid1.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.HighlightRow;
      
    2. Set the ForeColor of the highlight to WhiteSmoke:

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Me.C1TrueDBGrid1.HighLightRowStyle.ForeColor = Color.WhiteSmoke
      

      To write code in C#

      C#
      Copy Code
      this.c1TrueDBGrid1.HighLightRowStyle.ForeColor = Color.WhiteSmoke;
      
    3. Set the BackColor of the highlight to Navy:

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Me.C1TrueDBGrid1.HighLightRowStyle.BackColor = Color.Navy
      

      To write code in C#

      C#
      Copy Code
      this.c1TrueDBGrid1.HighLightRowStyle.BackColor = Color.Navy;
      

    What You've Accomplished

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