Articles in this section
Category / Section

Changing the color of the linklabel mousehover in WinForms GridGroupingControl

1 min read

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 WinForms Grid Control.

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)

 

Conclusion

I hope you enjoyed learning about how to change the color of the LinkLabel MouseHover in WinForms GridControl, GridGroupingControl and GridDataBoundGrid.

You can refer to our WinForms Grid feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms Grid documentation to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

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