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

RadScheduleView TimeRuler command

0 Answers 74 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Johann
Top achievements
Rank 1
Johann asked on 30 Nov 2016, 09:33 AM

Hi,

I use the RadScheduleView and I try to add an command to the TimeRuler line (on each date). I implement custom TimeRulerItemTemplateSelector like this : 

TimeRulerItemTemplateSelector="{StaticResource CustomTimeRulerItemTemplateSelector}"

 

In this template, I use the HorizontalTimelineGroupTemplate with an TextBlock to format the text. This works great. I want to add an command to this TextBlock (or a button), but the command is never raised.

I have try with the InputBinding :

<selectors:CustomTimeRulerItemTemplateSelector.HorizontalTimelineGroupTemplate>
    <DataTemplate>
        <TextBlock  TextAlignment="Left" Padding="2,0">
            <TextBlock.Text>
                <MultiBinding Converter="{StaticResource DateToStringFormatConverter}">
                    <Binding Path="DateTime" />
                    <Binding Path="DataContext.PlanningHelper.GroupHeaderStringFormat" RelativeSource="{RelativeSource AncestorType={x:Type ucPlanning1:PlanningList}}" />
                </MultiBinding>
            </TextBlock.Text>
            <TextBlock.InputBindings>
                <MouseBinding Command="{Binding DataContext.TestCommand, RelativeSource={RelativeSource AncestorType={x:Type ucPlanning1:PlanningList}}}" MouseAction="LeftClick" />
            </TextBlock.InputBindings>
        </TextBlock>
    </DataTemplate>
</selectors:CustomTimeRulerItemTemplateSelector.HorizontalTimelineGroupTemplate>

 

And with telerik:EventToCommandBehavior.EventBindings :

<selectors:CustomTimeRulerItemTemplateSelector.HorizontalTimelineGroupTemplate>
    <DataTemplate>
        <TextBlock  TextAlignment="Left" Padding="2,0">
            <TextBlock.Text>
                <MultiBinding Converter="{StaticResource DateToStringFormatConverter}">
                    <Binding Path="DateTime" />
                    <Binding Path="DataContext.PlanningHelper.GroupHeaderStringFormat" RelativeSource="{RelativeSource AncestorType={x:Type ucPlanning1:PlanningList}}" />
                </MultiBinding>
            </TextBlock.Text>
            <telerik:EventToCommandBehavior.EventBindings>
                <telerik:EventBinding Command="{Binding DataContext.TestCommand, RelativeSource={RelativeSource AncestorType={x:Type ucPlanning1:PlanningList}}}" EventName="MouseEnter" />
            </telerik:EventToCommandBehavior.EventBindings>
        </TextBlock>
    </DataTemplate>
</selectors:CustomTimeRulerItemTemplateSelector.HorizontalTimelineGroupTemplate>

 

But my TestCommand is never call.

What's wrong with my code? How to implement command inside the TimeRuler?

Thanks for your help.

No answers yet. Maybe you can help?

Tags
ScheduleView
Asked by
Johann
Top achievements
Rank 1
Share this question
or