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

Resize visible days

1 Answer 14 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Amige
Top achievements
Rank 1
Veteran
Amige asked on 05 Aug 2020, 06:09 PM

I have a ScheduleView component inside a RadPane that is docked to Top as you can see in the Image1, I have 10 visible days with 3 groups, due to the size of the RadPane I can only see 3 days which is correct. Now, when I make the panel floating I would like to see the whole 10 days without having to scroll.

Is it possible automatically resize the visible days to fit in the available space?

This is the definition of my ScheduleView control:

<scheduleView:RadScheduleView x:Name="scheduleViewOrders" Grid.RowSpan="2" BorderThickness="0 1 1 1" MinAppointmentHeight="20" FirstVisibleTime="00:00" GroupHeaderContentTemplateSelector="{StaticResource CustomGroupHeaderContentTemplateSelector}" AppointmentItemContentTemplate="{ StaticResource AppointmentTemplate}" ResourceTypesSource="{StaticResource ResourcesTypes}" PreviewMouseWheel="ScheduleViewOrders_PreviewMouseWheel" xmlns:local="clr-namespace:ProductionScheduler.ViewModel.Production" HorizontalScrollBarVisibility="Visible" >
                                    <scheduleView:RadScheduleView.ActiveViewDefinition>
                                        <scheduleView:DayViewDefinition GroupFilter="{Binding GroupFilter}" Orientation="Horizontal" VisibleDays="10" MinorTickLength="1h"
                                                                        MajorTickLength="1h" MinTimeRulerExtent="3000"/>
                                    </scheduleView:RadScheduleView.ActiveViewDefinition>                                   
                                    <scheduleView:RadScheduleView.GroupDescriptionsSource>
                                        <scheduleView:GroupDescriptionCollection>
                                            <scheduleView:DateGroupDescription></scheduleView:DateGroupDescription>
                                            <scheduleView:ResourceGroupDescription ResourceType="Schedule" />
                                        </scheduleView:GroupDescriptionCollection>
                                    </scheduleView:RadScheduleView.GroupDescriptionsSource>                                   
                                </scheduleView:RadScheduleView>

 

And this is the definition of the GroupHeaderContentTemplateSelector:

<localStyles:CustomGroupHeaderContentTemplateSelector x:Key="CustomGroupHeaderContentTemplateSelector">
    <localStyles:CustomGroupHeaderContentTemplateSelector.HorizontalTemplate>
        <DataTemplate>
            <ContentPresenter Content="{Binding FormattedName}" Margin="2" Width="80" Height="30" VerticalAlignment="Center"/>
        </DataTemplate>
    </localStyles:CustomGroupHeaderContentTemplateSelector.HorizontalTemplate>
 
    <localStyles:CustomGroupHeaderContentTemplateSelector.VerticalTemplate>
        <DataTemplate>
            <telerik:LayoutTransformControl VerticalAlignment="Center">
                <telerik:LayoutTransformControl.LayoutTransform>
                    <RotateTransform Angle="0" />
                </telerik:LayoutTransformControl.LayoutTransform>
                <ContentPresenter Content="{Binding FormattedName}" Margin="5" Width="70"/>
            </telerik:LayoutTransformControl>
        </DataTemplate>
    </localStyles:CustomGroupHeaderContentTemplateSelector.VerticalTemplate>
 
    <localStyles:CustomGroupHeaderContentTemplateSelector.HorizontalResourceTemplate>
        <DataTemplate>
            <ContentPresenter Content="{Binding Name.DisplayName}" Margin="2" Width="80" Height="30" VerticalAlignment="Center"/>
        </DataTemplate>
    </localStyles:CustomGroupHeaderContentTemplateSelector.HorizontalResourceTemplate>
 
    <localStyles:CustomGroupHeaderContentTemplateSelector.VerticalResourceTemplate>
        <DataTemplate>
            <telerik:LayoutTransformControl VerticalAlignment="Center">
                <telerik:LayoutTransformControl.LayoutTransform>
                    <RotateTransform Angle="0" />
                </telerik:LayoutTransformControl.LayoutTransform>
                <ContentPresenter Content="{Binding FormattedName}" Margin="5" Width="60" Height="23" MaxHeight="23" MinHeight="23"/>
            </telerik:LayoutTransformControl>
        </DataTemplate>
    </localStyles:CustomGroupHeaderContentTemplateSelector.VerticalResourceTemplate>
     
</localStyles:CustomGroupHeaderContentTemplateSelector>

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 10 Aug 2020, 12:23 PM

Hello Amige,

You can create a property in your viewmodel to control the height of the group headers and update it when the state of the RadPane changes.

A similar approach has been explained in this forum thread. Instead of the Checked event, however, you can handle the PaneStateChange event of the RadDocking control.

Please give this a try and let me know if such an approach works for you.

Regards,
Dilyan Traykov
Progress Telerik

Tags
ScheduleView
Asked by
Amige
Top achievements
Rank 1
Veteran
Answers by
Dilyan Traykov
Telerik team
Share this question
or