Articles in this section
Category / Section

How to set grid model options in WinForms GridGroupingControl?

1 min read

Grid model options

There are six WinForms Grid Control model options that can be set to the grid cells, which are explained below in this article.

1. Activating Current Cell Behavior

In order to set the current cell activating behavior, the ActivateCurrentCellBehavior property can be used.

C#

//Activate current cell behavior
this.gridControl1.ActivateCurrentCellBehavior = GridCellActivateAction.SelectAll;

VB

'Activate current cell behavior
Me.gridControl1.ActivateCurrentCellBehavior = GridCellActivateAction.SelectAll

Activating current cell in WinForms Grid

2. Allow scroll for Current cell view

In order to set the visibility of the current cell, the AllowScrollCurrentCellInView property can be used.

C#

//Allow scroll for current cell view
this.gridControl1.AllowScrollCurrentCellInView = GridScrollCurrentCellReason.Activate;

VB

'Allow scroll for current cell view
Me.gridControl1.AllowScrollCurrentCellInView = GridScrollCurrentCellReason.Activate

3. Alpha Blend Selection Color

In order to have desired selection color, the AlphaBlendSelectionColor property is used to set the specified color.

C#

//Set Alpha Blend Selection Color
this.gridControl1.AlphaBlendSelectionColor = Color.OrangeRed;

VB

'Set Alpha Blend Selection Color
Me.gridControl1.AlphaBlendSelectionColor = Color.OrangeRed

Alpha blend selection color in WinForms Grid

4. ClickedOnDisabledCellBehavior

In order to change the disabled grid cell behavior on cell click, the ClickedOnDisabledCellBehavior property can be used.

C#

//Define the current cell behavior when disabled cell is clicked
this.gridControl1.ClickedOnDisabledCellBehavior = GridClickedOnDisabledCellBehavior.Default;

VB

'Define the current cell behavior when disabled cell is clicked
Me.gridControl1.ClickedOnDisabledCellBehavior = GridClickedOnDisabledCellBehavior.Default

5. Show Current Cell Border Behavior

In order to display the border of the current cell, the ShowCurrentCellBorderBehavior property can be used.

C#

//Show current cell border behavior
this.gridControl1.ShowCurrentCellBorderBehavior = GridShowCurrentCellBorder.HideAlways;

VB

'Show current cell border behavior
Me.gridControl1.ShowCurrentCellBorderBehavior = GridShowCurrentCellBorder.HideAlways

Current cell border in WinForms Grid

6. Default Grid Border Style

In order to change the border style of the grid cells, the DefaultGridBorderStyle property can be used.

C#

//Set default grid border style
this.gridControl1.DefaultGridBorderStyle = GridBorderStyle. DashDotDot;

VB

'Set default grid border style
Me.gridControl1.DefaultGridBorderStyle = GridBorderStyle. DashDotDot

Border style in WinForms Grid
Samples:

C#: GridModelOptions_CS

VB: GridModelOptions_VB

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied