SfRangeSlider Value changed event

hi all,

i'm using SfRangeSlider binded to a propery. With DragCompleted i'm able to to things based on the value but if i tap (not drag) on the control, the value changed but of course  DragCompleted is not fired. How can i handle also this scenario?

thanks


5 Replies

VV Vijayakumar Viswanathan Syncfusion Team October 3, 2022 12:55 PM UTC

Hi Luca,


Query: DragCompleted is not fired when the value was changed by tapping on the SfRangeSlider


In the SfRangeSlider, the DragCompleted event was fired only after the dragging of the thumb was ended. Here tapping on the range slider won't trigger the DragCompleted event. We recommend you to use the  ValueChanging event instead of the DragCompleted event to get the current value of the RangeSilder.


We have prepared a sample for your reference please get the sample from the attachment. Please let us know if you need any other details. If your requirement is different, please explain it to us briefly. It will help us to provide the proper solution at the easiest.


Thanks,

Vijayakumar V


Attachment: RangeSliderSample_beca33b8.zip


LU Luca October 3, 2022 01:00 PM UTC

hi , thank you for your response.

the problem is that ValueChanging is going to call my action always not just when i choose the value.

I mean, if i move from 10 to 60,  ValueChanging is going to be fired on 10,11,12....60 and not just on 60.

Am I in wrong?

thanks



VV Vijayakumar Viswanathan Syncfusion Team October 4, 2022 02:26 PM UTC

Hi Luca,


Query 1:  DragCompleted is not fired when the value was changed by tapping on the SfRangeSlider


In the SfRangeSlider, the DragCompleted event was fired only after the dragging of the thumb was ended. Here tapping on the range slider won't trigger the DragCompleted event. So we have prepared one workaround sample to achieve your behavior.


In the sample, we have used DragStarted, DragCompleted, and ValueChanging events. We have updated the label text from DragCompleted and ValueChanging events. We have restricted the ValueChanging event on dragging also. Please get the sample from the attachment. Please let us know if the reported sample resolved your need.


Thanks,

Vijayakumar V


Attachment: RangeSliderSample_dd6dc2d8.zip


LU Luca October 4, 2022 04:01 PM UTC

hi,

yestarday i did exactly what you are proposing but it's not ok because when i move as first thing rangeslider_ValueChanging is fired and then also dragStarted but here dragStarted_bool is still false.

This means that i'm going to call my action (that it's an API) twice and not just one time.

Maybe it could be ok for an update of a label, but not if i'm going to call an API that lasts seconds and uses resources.

Tell me if i am in wrong.

thanks



VV Vijayakumar Viswanathan Syncfusion Team October 5, 2022 02:18 PM UTC

Hi Luca,


Query 1:  DragCompleted is not fired when the value was changed by tapping on the SfRangeSlider


We have checked the sample in all three platforms and ensured that when dragging the thumb the DragStarted event was called first and then the ValueChanging event was called. If we tap the thumb or track the ValueChanging event was called first. So your use case was resolved properly using it.


Since this was the only possible workaround for this use case, kindly check the sample and let us know the details. If this use case was not matching for your requirement kindly share your requirement with the sample or a video. It will help us to investigate further.


Thanks,

Vijayakumar V


Attachment: RangeSliderSample_fd6e26cb.zip

Loader.
Up arrow icon