We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to prevent the blackout selection when AllowSelection is set to None or Any in WinForms GridControl, GridGroupingControl and GridDataBoundGrid?

Platform: WinForms |
Control: GridControl
Tags: selection

Selection backcolor

By default, the selected rows or columns or cells are highlighted with AlphaBlend color. The Selection Backcolor is highlighted with Black color, by changing the AllowSelection property to None. The following image illustrates the exact issue.

Show the backcolor while changing AllowSelection from Any to None

As per the architecture, the Selection Backcolor is removed from the graphics when changing AllowSelection to None. This article provides the information about how to resolve it.


To resolve the Selection Backcolor issue, the GridSelectionFlags.AlphaBlend property can be used along with the GridSelectionFlags.None property as GridSelectionFlags.None | GridSelectionFlags.AlphaBlend while setting the AllowSelection to None.


private void noneAllowSelection_CheckedChanged(object sender, EventArgs e)
   //Sets the AllowSelection property to None
   this.gridGroupingControl1.TableOptions.AllowSelection = Syncfusion.Windows.Forms.Grid.GridSelectionFlags.None | Syncfusion.Windows.Forms.Grid.GridSelectionFlags.AlphaBlend;
private void anyAllowSelection_CheckedChanged(object sender, EventArgs e)
   //Sets the AllowSelection property to Any
   this.gridGroupingControl1.TableOptions.AllowSelection = Syncfusion.Windows.Forms.Grid.GridSelectionFlags.Any;


Private Sub noneAllowSelection_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles noneAllowSelection.CheckedChanged
   'Sets the AllowSelection property to None
   Me.gridGroupingControl1.TableOptions.AllowSelection =   Syncfusion.Windows.Forms.Grid.GridSelectionFlags.None Or Syncfusion.Windows.Forms.Grid.GridSelectionFlags.AlphaBlend
End Sub
Private Sub anyAllowSelection_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles anyAllowSelection.CheckedChanged
   'Sets the AllowSelection property to Any
   Me.gridGroupingControl1.TableOptions.AllowSelection = Syncfusion.Windows.Forms.Grid.GridSelectionFlags.Any
End Sub



This is applicable for GridControl and GridDataBoundGrid also.


The following image illustrates the Selection Backcolor as a Default Selection Backcolor.

Show the backcolor while changing AllowSelection from Any to None


C#: Selection_Backcolor_CS

VB: Selection_Backcolor_VB

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile