private CalendarLinkLabelCellType CreateAddressLinkLabelCell()
{
CalendarLinkLabelCellType linkLabelCell = new CalendarLinkLabelCellType();
// Customize behavior of link label.
linkLabelCell.LinkBehavior = LinkBehavior.HoverUnderline;
// Customize colors when link label in different status.
linkLabelCell.LinkColor = Color.Blue;
linkLabelCell.ActiveLinkColor = Color.Red;
linkLabelCell.VisitedLinkColor = Color.Purple;
return linkLabelCell;
}
void gcCalendarGrid1_CellClick(object sender, CalendarCellEventArgs e)
{
if (e.CellPosition.Name == "Address")
{
CalendarCell cell = gcCalendarGrid1[e.CellPosition.Date][e.CellPosition.RowIndex, e.CellPosition.ColumnIndex];
if (cell.CellType is CalendarLinkLabelCellType)
{
object link = (cell.CellType as CalendarLinkLabelCellType).Text;
if (link != null)
{
Process.Start(link.ToString());
}
}
}
gcCalendarGrid1.LayoutSettings.PerformHorizontalAutoFit(0);
}
Private Function CreateAddressLinkLabelCell() As CalendarLinkLabelCellType
Dim linkLabelCell As New CalendarLinkLabelCellType()
' Customize behavior of link label.
linkLabelCell.LinkBehavior = LinkBehavior.HoverUnderline
' Customize colors when link label in different status.
linkLabelCell.LinkColor = Color.Blue
linkLabelCell.ActiveLinkColor = Color.Red
linkLabelCell.VisitedLinkColor = Color.Purple
Return linkLabelCell
End Function
Private Sub gcCalendarGrid1_CellClick(sender As Object, e As CalendarCellEventArgs)
If e.CellPosition.Name = "Address" Then
Dim cell As CalendarCell = gcCalendarGrid1(e.CellPosition.[Date])(e.CellPosition.RowIndex, e.CellPosition.ColumnIndex)
If TypeOf cell.CellType Is CalendarLinkLabelCellType Then
Dim link As Object = TryCast(cell.CellType, CalendarLinkLabelCellType).Text
If link IsNot Nothing Then
Process.Start(link.ToString())
End If
End If
End If
gcCalendarGrid1.LayoutSettings.PerformHorizontalAutoFit(0)
End Sub