RadSlider rangemove disable with mousedrag

8 posts, 0 answers
  1. Deepa
    Deepa avatar
    5 posts
    Member since:
    Mar 2011

    Posted 07 Mar 2011 Link to this post

    Hi

    I am setting

    StepAction="MoveRange" and range is moving with the mouse click.

     

     

     

    But the issue is that when I a dragging mouse then range is changing. How do I disable the Mouse drag.




    HorizontalAlignment
    ="Right"

     

     

     

     

    IsSnapToTickEnabled="True"

     

     

     

     

    Margin="0,10,12,52"

     

     

     

     

    Minimum="1"

     

     

     

     

    Name="monthSlider"

     

     

     

     

    Maximum="12"

     

     

     

     

    SmallChange="0"

     

     

     

     

    StepAction="MoveRange"

     

     

     

    TickFrequency="1"

     

     

     

    LargeChange="3"

     

     

     

     

    SelectionEnd="3"

     

     

     

    SelectionStart="1"

     

     

     

    IsSelectionRangeEnabled="True"

     

     

     

     

    SelectionRangeChanged="monthSlider_SelectionRangeChanged"

     

  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 10 Mar 2011 Link to this post

    Hello Deepa,

    Usually, you can use the DragStarted event of the RadSlider and set e.handled = true. But it appears to be a bug in the DragStarted event, you will be soon able to track its progress in PITS (Slider: In DragStartedEventHandler the RoutedEvent of the RoutedEventArgs is not set). However , there is a workaround that uses the PreviewMouseLeftButtonDown event. You can examine it in the attached solution.

    Best wishes,
    Petar Mladenov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. UI for WPF is Visual Studio 2017 Ready
  4. Deepa
    Deepa avatar
    5 posts
    Member since:
    Mar 2011

    Posted 17 Mar 2011 Link to this post

    Hi
    Thanks for ur help.

    Range move disable is working.

    But i have a different issue now.

    In one of the slider I am displaying 12 months with tick. I dont select any range.

    But I want to disable tick and drag based on certail condition.

    Say for example If I have data only for Jan to April then i will display all 12 months in the slider but I want to disable tick for rest of the months so user should be able to click or drag on Jan to Apr but not rest of the  months

    Please help.

    Thanks
    Deepa
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 19 Mar 2011 Link to this post

    Hello Deepa,

    Please examine the attached solution where a basic approach is realized. It uses TemplateSelector and IntToMonthConverter. In order to prevent the selection of month after April, the ValueChangedEvent is used which is not very elegant but it works. We are now working on major refactoring of the RadSlider and PreviewValueChanged is in our to-do list. Feel free to ask if you need further assistance.

    All the best,
    Petar Mladenov
    the Telerik team
  6. Deepa
    Deepa avatar
    5 posts
    Member since:
    Mar 2011

    Posted 21 Mar 2011 Link to this post

    Hi
    Thanks for your help. I am able to disable click and drag in the value change event of the month slider.

    I have another range slider where I am firing rangechange.

    How do I disable move based on some condition

    Thanks in advance for your help.

    Regards
    Deepa.

  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 24 Mar 2011 Link to this post

    Hi Deepa,

    You can then use analogically the SelectionStartChanged, SelectionEndChanged and SelectionRangeChanged events.

    Regards,
    Petar Mladenov
    the Telerik team
  8. Deepa
    Deepa avatar
    5 posts
    Member since:
    Mar 2011

    Posted 24 Mar 2011 Link to this post

    Hi

    Thanks for you help. Disabling is working for me now.

    I need one more help. i have two slider one is month slider and the other one is quarterslider.

    Quarterslider is the rangeslider mean I move range of month so (Jan - Mar) is the first quarter and April - June second quarter etc.

    When I am sliding through the month in the month slider then I need to manipulate which quarter I am based on the selected month accordingly quarter slider range should change.

    I was setting quarterSlider.SelectionStart and quarterSlider.SelectionEnd outslider the slider control that means in the monthslider value cange event. But this is not working it is going on infinite loop. SelectionrangeChane of quarterslider  fires each time.

    Thanks for your help in advance.

    Regards
    Deepa
  9. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 30 Mar 2011 Link to this post

    Hello Deepa,

    We were experiencing some issues with the TickTemplateSelector in the previous Q but we have resolved them. You could send us a runnable sample showing the issue and we will investigate your  problem. You could also see a possible approach in the attached solution. It's not working perfectly but should be a good starting point. You should also know that we a recurrently working on major refactoring of this control and its new version should be announced with the SP1 (mid April).

    Best wishes,
    Petar Mladenov
    the Telerik team
Back to Top
UI for WPF is Visual Studio 2017 Ready