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

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.v19.1.dll

Declaration

public class ResourceHeaderControl :
    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.

ResourceHeadersWithImages

<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>

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ResourceHeaderControl class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also