Skip to main content

GanttView.TaskContentTemplate Property

Gets or sets a template that defines the task content appearance. This is a dependency property.

Namespace: DevExpress.Xpf.Gantt

Assembly: DevExpress.Xpf.Gantt.v22.2.dll

NuGet Package: DevExpress.Wpf.Gantt


public DataTemplate TaskContentTemplate { get; set; }

Property Value

Type Description

A template that defines the task content appearance.


Each task in the Gantt area displays a label with its name. If you want to display custom content, create a template and assign it to the TaskContentTemplate property:

<dxgn:GanttControl ItemsSource="{Binding Items}">
        <dxgn:GanttColumn BindTo="Name"/>
        <dxgn:GanttColumn BindTo="StartDate"/>
        <dxgn:GanttColumn BindTo="FinishDate"/>
        <dxgn:GanttView ...>
                    <TextBlock Text="{DXBinding 'Row.ResourceName'}" />

Use the TaskContentPosition property to specify the task content position.

You can implement a selector to apply the template according to custom logic. Refer to the following topic for more information: TaskContentTemplateSelector.

If View contains both TaskContentTemplate and TaskContentTemplateSelector, the GanttControl renders the template assigned to the TaskContentTemplate property.

See Also