Back to Devexpress

ResourceTreeControl.ResourceCellTemplate Property

wpf-devexpress-dot-xpf-dot-scheduling-dot-resourcetreecontrol-57be6779.md

latest3.6 KB
Original Source

ResourceTreeControl.ResourceCellTemplate Property

Gets or sets the template that defines the presentation of resource cells. This is a dependency property.

Namespace : DevExpress.Xpf.Scheduling

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

NuGet Package : DevExpress.Wpf.Scheduling

Declaration

csharp
[Browsable(false)]
public DataTemplate ResourceCellTemplate { get; set; }
vb
<Browsable(False)>
Public Property ResourceCellTemplate As DataTemplate

Property Value

TypeDescription
DataTemplate

A System.Windows.DataTemplate object that defines the presentation of resource cells.

|

Remarks

To enable synchronization with the ResourceTreeControl.Scheduler, use an editor shipped with the DevExpress Data Editors Library for WPF. Setting the editor’s Name to ‘ PART_Editor ‘ bounds the editor to a source field specified by the ResourceMappings.Caption property of the SchedulerControl.DataSource.

See the example below.

xaml
<dxsch:ResourceTreeControl Scheduler="{Binding ElementName=scheduler}">
            <dxsch:ResourceTreeControl.ResourceCellTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <dxe:TextEdit x:Name="PART_Editor"/>
                        <dxe:TextEdit EditValue="{Binding RowData.Row.CustomFields.Phone, Mode=OneWay}" IsEnabled="False" ShowBorder="False" />
                    </StackPanel>
                </DataTemplate>
            </dxsch:ResourceTreeControl.ResourceCellTemplate>
        </dxsch:ResourceTreeControl>
        <dxsch:SchedulerControl x:Name="scheduler" GroupType="Resource">
            <dxsch:TimelineView>
                <dxsch:TimelineView.TimeScales>
                    <dxsch:TimeScaleDay />
                    <dxsch:TimeScaleWorkHour />
                </dxsch:TimelineView.TimeScales>
            </dxsch:TimelineView>
            <!--region #Mappings-->
            <dxsch:SchedulerControl.DataSource>
                <dxsch:DataSource ResourcesSource="{Binding MainResources}">
                    <dxsch:DataSource.ResourceMappings>
                        <dxsch:ResourceMappings
                            Caption="Name"
                            Id="Id"
                            Visible="IsVisible">
                            <dxsch:CustomFieldMapping Mapping="ResourceImage" Name="Photo" />
                            <dxsch:CustomFieldMapping Mapping="Phone" />
                        </dxsch:ResourceMappings>
                    </dxsch:DataSource.ResourceMappings>
                </dxsch:DataSource>
            </dxsch:SchedulerControl.DataSource>
            <!--endregion #Mappings-->
        </dxsch:SchedulerControl>

See Also

ResourceTreeControl Class

ResourceTreeControl Members

DevExpress.Xpf.Scheduling Namespace