Back to Devexpress

ResourceHeaderControl Class

wpf-devexpress-dot-xpf-dot-scheduling-dot-visual-a11b998a.md

latest4.0 KB
Original Source

ResourceHeaderControl Class

A view’s column (or row) heading that indicates a column (or row) belonging to a particular resource.

Namespace : DevExpress.Xpf.Scheduling.Visual

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

NuGet Package : DevExpress.Wpf.Scheduling

Declaration

csharp
public class ResourceHeaderControl :
    HeaderControl
vb
Public Class ResourceHeaderControl
    Inherits HeaderControl

Remarks

A resource header is visible only when the scheduler is grouped by resources or dates (use the SchedulerControl.GroupType property to set grouping).

Example

The following code defines a resource header’s data template. It has a gray background, shows an image obtained using the Custom Fields and displays the ResourceItem.Caption text with a custom font. The data template is assigned to the SchedulerViewBase.ResourceHeaderContentTemplate property.

View Example

xaml
<Window.Resources>
    <DataTemplate x:Key="resourceHeaderContentTemplate">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Image
                MaxWidth="120"
                MaxHeight="120"
                HorizontalAlignment="Center"
                DockPanel.Dock="Top"
                RenderOptions.BitmapScalingMode="NearestNeighbor"
                Source="{Binding Resource.CustomFields.Photo}"
                Stretch="Uniform" />
            <StackPanel Grid.Row="1">
                <TextBlock
                    HorizontalAlignment="Center"
                    FontWeight="Bold"
                    Text="{Binding Resource.Caption}" />
            </StackPanel>
        </Grid>
    </DataTemplate>
    <Style TargetType="dxschv:ResourceHeaderControl">
        <Setter Property="ContentOrientation" Value="Horizontal" />
        <Setter Property="Background" Value="LightGray"/>
    </Style>
</Window.Resources>

Inheritance

Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control ContentControl HeaderControl ResourceHeaderControl

See Also

ResourceHeaderControl Members

Resources

Appearance Customization

Custom Fields

DevExpress.Xpf.Scheduling.Visual Namespace