)
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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to change the color of the LinkLabel MouseHover in WinForms GridControl, GridGroupingControl and GridDataBoundGrid?

Platform: WinForms |
Control: GridDataBoundGrid(Classic) |
Published Date: April 19, 2015 |
Last Revised Date: February 11, 2020

Change the color of link label

The color of the LinkLabelCell on mouse hover can be changed by using the ActiveLinkColor property and the LinkLabelCellRenderer class. The LinkLabelCellRenderer has been taken from the CellRenderers collection of the GridControl.

The following code example shows how to set the LinkLabelCell’s ActiveLinkColor.

C#

LinkLabelCellRenderer rend = this.gridControl1.CellRenderers["LinkLabelCell"] as LinkLabelCellRenderer;
rend.ActiveLinkColor = Color. Red;
//Sets the LinkLabelTextColor (mousehover color to remain as no color).

VB

Dim rend As LinkLabelCellRenderer = TryCast(Me.gridControl1.CellRenderers("LinkLabelCell"), LinkLabelCellRenderer)
rend.ActiveLinkColor = Color. Red
'Sets the LinkLabelTextColor (mousehover color to remain as no color).

 

Show the link label in cell

Figure 1: Link Label Cell

Note:

You can achieve the same by using the GridDataBoundGrid and GridGroupingControl.

The following code example can be used to get the LinkLabelCellRenderer from the CellRenderers collection of the GridGroupingControl and GridDataBoundGrid, and vice versa.

C#

//Gets the CellRenderer in the GridDataBoundGrid.
LinkLabelCellRenderer rend1 = this.griddataboundgrid1.CellRenderers["LinkLabelCell"] as LinkLabelCellRenderer;
//Gets the CellRenderer in the GridGroupingControl.
LinkLabelCellRenderer rend1 = this.gridGroupingControl1.TableControl.CellRenderers["LinkLabelCell"] as LinkLabelCellRenderer;

VB

'Gets the CellRenderer in the GridDataBoundGrid.
Dim rend1 As LinkLabelCellRenderer = TryCast(Me.griddataboundgrid1.CellRenderers("LinkLabelCell"), LinkLabelCellRenderer)
'Gets the CellRenderer in the GridGroupingControl.
Dim rend1 As LinkLabelCellRenderer = TryCast(Me.gridGroupingControl1.TableControl.CellRenderers("LinkLabelCell"), LinkLabelCellRenderer)

Samples:

C#: LinkLabel_C#

VB: LinkLabel_VB

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
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
Live Chat Icon