Edit this page

GraphicalView item formatting

The GraphicalViewItemFormatting event allows you to change the style and looks of the items displayed in the graphical view. The following example demonstrates how to format all tasks that involve some selection e.g. their title starts with "Select".

private void radGanttView1_GraphicalViewItemFormatting(object sender, GanttViewGraphicalViewItemFormattingEventArgs e)
{
    if (e.Item.Title.StartsWith("Select"))
    {
        e.ItemElement.TaskElement.BackColor = Color.Lime;
    }
    else
    {
        e.ItemElement.TaskElement.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local);
    }
}

Private Sub radGanttView1_GraphicalViewItemFormatting(sender As Object, e As GanttViewGraphicalViewItemFormattingEventArgs)
    If (e.Item.Title.StartsWith("Select")) Then
        e.ItemElement.TaskElement.BackColor = Color.Lime
    Else
        e.ItemElement.TaskElement.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local)
    End If
End Sub

ganttview-formatting-graphicalviewitem-formatting 001

See Also