This is a migrated thread and some comments may be shown as answers.

Width of GroupHeaders

1 Answer 102 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Matthias
Top achievements
Rank 1
Matthias asked on 26 Feb 2016, 01:29 PM

Hi,

is there a way to prevent the vertical weekview from showing horizontal scrollbars by narrowing the groupheaders to the available space? I also realized, that when you put a lot of appointments into one slot, this group gets more space than the others.

What I want is, that every column has the exact same width and they use only the space available in the current window without horizontal scrolling.

Thanks

Matthias

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 29 Feb 2016, 02:07 PM
Hi Matthias,

You could narrow the width of the GroupHeaders in WeekViewDefinition by customizing the GroupHeaderContentTemplateSelector of RadScheduleView,   you will need to set Width inside its HorizontalTemplate, please check the following snippet:

<telerik:GroupHeaderTemplateSelector x:Key="GroupHeaderContentTemplateSelector">
    <telerik:GroupHeaderTemplateSelector.HorizontalTemplate>
        <DataTemplate>
            <!--Change the Width here-->
            <TextBlock Text="{Binding Name, StringFormat={}{0:ddd}}" Margin="2" Width="25"/>
        </DataTemplate>
    </telerik:GroupHeaderTemplateSelector.HorizontalTemplate>
    <telerik:GroupHeaderTemplateSelector.VerticalTemplate>
        <DataTemplate>
            <ContentPresenter Content="{Binding FormattedName}" Margin="4" Height="16" VerticalAlignment="Top">
                <ContentPresenter.LayoutTransform>
                    <RotateTransform Angle="-90"/>
                </ContentPresenter.LayoutTransform>
            </ContentPresenter>
        </DataTemplate>
    </telerik:GroupHeaderTemplateSelector.VerticalTemplate>
</telerik:GroupHeaderTemplateSelector>

The approach is explained in details in Templating the GroupHeaders topic in our documentation.

This, however, will not prevent having wider groups when there are more appointments, you could set MinAppointmentWidth property of the ScheduleView to a smaller value in order to avoid this to some extent:

<telerik:RadScheduleView x:Name="radScheduleView"
    AppointmentsSource="{Binding Appointments}"                            
    GroupHeaderContentTemplateSelector="{StaticResource GroupHeaderContentTemplateSelector}"
    MinAppointmentWidth="5">


Hope this will be helpful.

Regards,
Yana
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ScheduleView
Asked by
Matthias
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or