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

Custom navigation header on scheduleview - hide view button, add custom button, alter date format

3 Answers 204 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Rick Tett
Top achievements
Rank 1
Rick Tett asked on 24 Oct 2011, 07:38 PM
I may be missing it, but I am not finding a way to alter the top navigation bar on the scheduleview either in the documentation or the forum.  I am using the Timeline view only and I want to do three things:
a) hide the Timeline view button
b) change the format of the date range to "MM/YY" instead of "DD MM YYYY"
c) add custom buttons on it

See the attached image showing my bar and desired changes...

3 Answers, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 25 Oct 2011, 09:24 AM
Hi Rick,

Normally, you would need to change the template of RadScheduleView control - to remove the ListBox which holds the ViewDefinitions as its Items and to insert your own visual elements. This would require that you include in your project a lot of xaml mark-up.

So I would suggest that you use the approach demonstrated in the online FirstLook example of RadScheduleView. You can hide the navigation header via NavigationHeaderVisibility="Collapsed" and place your own visual elements.

For changing the formatting of the visible range text, however, you do need to edit the RadScheduleView template. Contained in the NavigationHeader Border, you will find the following ContentControl:
<ContentControl x:Name="CurrentInterval" Content="{TemplateBinding CurrentVisibleRangeText}" 
                                                    HorizontalAlignment="Right" 
                                                    Style="{StaticResource NavigationIntervalStyle}" 
                                                    VerticalAlignment="Center"/>

If you bind to VisibleRange instead of CurrentVisibleRangeText, and provide a custom style that contains string formatted TextBlocks:

<Style x:Key="NavigationIntervalStyle2" TargetType="ContentControl">
            <Setter Property="Margin" Value="5"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="HorizontalAlignment" Value="Right"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Foreground="{StaticResource NavigationIntervalForegroundFront}" Text="{Binding Start, StringFormat=dd/MM}"/>
                            <TextBlock Text="-" Foreground="{StaticResource NavigationIntervalForegroundFront}" />
                            <TextBlock Foreground="{StaticResource NavigationIntervalForegroundFront}" Text="{Binding End, StringFormat=dd/MM}"/>
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>

you will be able to change the formatting of the visible range text.

I hope this will help in customizing your instance of RadScheduleView.


Kind regards,
Dani
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Kjell
Top achievements
Rank 1
answered on 25 Nov 2011, 09:03 PM
Is there a way to do this at the view definition level?  I want to change the format on the week view but don't want it to impact the month view.
0
Dani
Telerik team
answered on 28 Nov 2011, 11:28 AM
Hi Kjell,

If you want to change the formatting depending on the view definition, basically what you can do is, taking into account the suggested approach from my previous post,  have two ContentControls and bind their Visibility to the ActiveViewDefinition via a Converter. This way you will be able to provide differently formatted values for WeekView and MonthView.

I hope this helps.

All the best,
Dani
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
ScheduleView
Asked by
Rick Tett
Top achievements
Rank 1
Answers by
Dani
Telerik team
Kjell
Top achievements
Rank 1
Share this question
or