Skip to main content

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.v24.2.dll

NuGet Package: DevExpress.Wpf.Scheduling

Declaration

[Browsable(false)]
public DataTemplate ResourceCellTemplate { get; set; }

Property Value

Type Description
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.

         <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