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

Dragging Status

3 Answers 78 Views
TimeBar
This is a migrated thread and some comments may be shown as answers.
Kirk
Top achievements
Rank 1
Kirk asked on 12 Mar 2012, 07:14 PM
Is it possible with the TimeBar to tell when a user is dragging the selection around?

I tried using the mouse down event but if you click on the selection bar it is not fired. What is handling this event? What part of the control captures the mouse when you do this?

Also is there anyway to preview the StartSelection value while your moving the bar around?

3 Answers, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 15 Mar 2012, 03:29 PM
Hello Kirk,

You can use the ActualSelectionStart and ActualSelectionEnd properties of the timeBar to get the selection values while the user is moving the selection element.

Could you please explain in greater detail what you are trying to achieve? It will be best if you send me the code that you tried and did not work for you.

All the best,
Tsvetie
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Kirk
Top achievements
Rank 1
answered on 15 Mar 2012, 03:43 PM
Thank you for pointing out the ActualSelectionStart, I missed that somehow. That will make things nicer.

Here is what I came up with for knowing when the dragging starts. Let me know if there is a better way.

I had to pull out the SelectionThumb style and add events to the center handle to see when the drag started, changed, and ended.
<Style x:Key="dragSelectionThumbStyle" TargetType="telerik:SelectionThumb">
    <Setter Property="Margin" Value="{StaticResource TimeBar_SelectionThumb_Margin}"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="telerik:SelectionThumb">
                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                    <Grid>
                        <Thumb x:Name="PART_CenterHandle" Style="{StaticResource SelectionRangeStyle}" DragStarted="PART_CenterHandle_DragStarted" DragDelta="PART_CenterHandle_DragDelta" DragCompleted="PART_CenterHandle_DragCompleted" />
                        <Thumb x:Name="PART_LeftHandle" HorizontalAlignment="Left" Style="{StaticResource SelectionThumbHandleStyle_Flipped}" />
                        <Thumb x:Name="PART_RightHandle" HorizontalAlignment="Right" Style="{StaticResource SelectionThumbHandleStyle}" />
                    </Grid>
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>
0
Tsvetie
Telerik team
answered on 16 Mar 2012, 09:08 AM
Hello Kirk,

The solution you came up is actually what I had in mind. Thank you for sharing it with us.

All the best,
Tsvetie
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
TimeBar
Asked by
Kirk
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Kirk
Top achievements
Rank 1
Share this question
or