Gets or sets a value that represents the behavior of a link.
The following code example shows how to customize a link label cell's behavior or appearance. This code example is part of a larger example provided for the
LinkLabelCell class.
private LinkLabelCell CreateAddressLinkLabelCell()
{
LinkLabelCell linkLabelCell = new LinkLabelCell();
linkLabelCell.Selectable = false;
linkLabelCell.Name = "Address";
// Customize behavior of link label.
linkLabelCell.LinkBehavior = LinkBehavior.HoverUnderline;
// Customize colors when link label is in different state.
linkLabelCell.LinkColor = Color.Blue;
linkLabelCell.ActiveLinkColor = Color.Red;
linkLabelCell.VisitedLinkColor = Color.Purple;
return linkLabelCell;
}
void gcMultiRow1_CellClick(object sender, CellEventArgs e)
{
if (e.CellName == "Address")
{
object value = gcMultiRow1[e.RowIndex, e.CellIndex].Value;
if (value != null)
{
Process.Start(value.ToString());
}
}
}
Private Function CreateAddressLinkLabelCell() As LinkLabelCell
Dim linkLabelCell As New LinkLabelCell()
linkLabelCell.Selectable = False
linkLabelCell.Name = "Address"
' Customize behavior of link label.
linkLabelCell.LinkBehavior = LinkBehavior.HoverUnderline
' Customize colors when link label has a different status.
linkLabelCell.LinkColor = Color.Blue
linkLabelCell.ActiveLinkColor = Color.Red
linkLabelCell.VisitedLinkColor = Color.Purple
Return linkLabelCell
End Function
Private Sub gcMultiRow1_CellClick(ByVal sender As Object, ByVal e As CellEventArgs) Handles
gcMultiRow1.CellClick
If e.CellName = "Address" Then
Dim value As Object = gcMultiRow1(e.RowIndex, e.CellIndex).Value
If value <> Nothing Then
Process.Start(value.ToString())
End If
End If
End Sub
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2