New to Telerik UI for WinFormsStart a free 30-day trial

GraphicalView Link Item Formatting

Updated over 6 months ago

RadGanttView allows formatting of individual links through the GraphicalViewLinkItemFormatting event. The following example demonstrates how to format links based on their type.

C#
private void radGanttView1_GraphicalViewLinkItemFormatting(object sender, GanttViewLinkItemFormattingEventArgs e)
{
    Color color = Color.Black;
    DashStyle dash = DashStyle.Solid;
    switch (e.Link.LinkType)
    {
        case TasksLinkType.FinishToFinish:
            dash = DashStyle.DashDotDot;
            color = Color.Red;
            break;
        case TasksLinkType.FinishToStart:
            dash = DashStyle.Dash;
            color = Color.Green;
            break;
        case TasksLinkType.StartToFinish:
            dash = DashStyle.DashDot;
            color = Color.Blue;
            break;
        case TasksLinkType.StartToStart:
            dash = DashStyle.Dot;
            color = Color.Black;
            break;
    }
    Pen pen = new Pen(color);
    pen.DashStyle = dash;
    pen.Width = 3;
    pen.LineJoin = LineJoin.Bevel;
    pen.EndCap = LineCap.ArrowAnchor;
    e.Pen = pen;
}

WinForms RadGanttView GraphicalView Link Item Formatting

See Also

In this article
See Also
Not finding the help you need?
Contact Support