ComponentOne True DBGrid for WinForms
True DBGrid for WinForms Task-Based Help / Setting the Grid's Appearance / Disabling Selected Highlight
In This Topic
    Disabling Selected Highlight
    In This Topic

    You can disable cell highlighting by setting the MarqueeStyle and SelectedStyle properties. To highlight the row of the selected cell, set the MarqueeStyle property to NoMarquee. See Highlighting the Current Row or Cell for details. To disable the selected style, change the SelectedStyle property's attributes.

    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 NoMarquee.
    2. Click the ellipsis button next to the SelectedStyle property in the Properties window to open the Style Editor.
    3. On the Contents tab, set the ForeColor to Black.
    4. On the Fill Effects tab, set the BackColor to Transparent.
    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 NoMarquee 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.NoMarquee
      

      To write code in C#

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

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Me.C1TrueDBGrid1.SelectedStyle.ForeColor = Color.Black
      

      To write code in C#

      C#
      Copy Code
      this.c1TrueDBGrid1.SelectedStyle.ForeColor = Color.Black;
      
    3. Set the BackColor of the highlight to Transparent:

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Me.C1TrueDBGrid1.Selected.BackColor = Color.Transparent
      

      To write code in C#

      C#
      Copy Code
      this.c1TrueDBGrid1.Selected.BackColor = Color.Transparent;
      

    What You've Accomplished

    Selected cells, rows, and columns will no longer display any indicating highlighting.