Back to Devexpress

GanttView.PrintTaskContentTemplate Property

wpf-devexpress-dot-xpf-dot-gantt-dot-ganttview-77cb5938.md

latest2.8 KB
Original Source

GanttView.PrintTaskContentTemplate Property

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

Namespace : DevExpress.Xpf.Gantt

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

NuGet Package : DevExpress.Wpf.Gantt

Declaration

csharp
public DataTemplate PrintTaskContentTemplate { get; set; }
vb
Public Property PrintTaskContentTemplate As DataTemplate

Property Value

TypeDescription
DataTemplate

A template that defines the task content appearance.

|

Remarks

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 PrintTaskContentTemplate property:

xaml
<dxgn:GanttControl ItemsSource="{Binding Items}">
    <dxgn:GanttControl.View>
        <dxgn:GanttView ...>
            <dxgn:GanttView.PrintTaskContentTemplate>
                <DataTemplate>
                    <TextBlock Text="{DXBinding 'Row.Name'}" 
                               Foreground="White" 
                               Background="PaleVioletRed" 
                               FontStyle="Italic"/>
                </DataTemplate>
            </dxgn:GanttView.PrintTaskContentTemplate>
        </dxgn:GanttView>
    </dxgn:GanttControl.View>
</dxgn:GanttControl>

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

If View contains both PrintTaskContentTemplate and PrintTaskContentTemplateSelector, the GanttControl renders the template assigned to the PrintTaskContentTemplate property.

Refer to the following topic for more information on how to customize the printed document: Print and Export.

See Also

GanttView Class

GanttView Members

DevExpress.Xpf.Gantt Namespace