Skip to main content
A newer version of this page is available. .

GanttView.TaskContentTemplate Property

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

Namespace: DevExpress.Xpf.Gantt

Assembly: DevExpress.Xpf.Gantt.v19.1.dll

Declaration

public DataTemplate TaskContentTemplate { get; set; }

Property Value

Type Description
DataTemplate

A template used to render task content.

Remarks

You can display custom task content in the Gantt area next to tasks. Use the TaskContentPosition property to specify the task content position. The TaskContentTemplate property allows you to specify the template that defines the task content presentation.

If you have more than one template that can be used to render task contents, you can implement custom logic to choose the required template. To do this, derive from the DataTemplateSelector class, implement the SelectTemplate method that returns a template which meets the required condition, and assign it to the TaskContentTemplateSelector property.

If both the TaskContentTemplate and TaskContentTemplateSelector are specified, task contents are rendered using the template returned by the template selector. If the template selector returns null, the template specified by the TaskContentTemplate property is used.

Example

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