We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

App crasing while trying to get rangSlider.RangeEnd value

Hi,
I am trying to implement range slider for windows rt. I have added a range slider with the following in xaml
<editors:SfRangeSlider
                                Visibility="Visible"
                                x:Name="sliderFlash"
                                Height="80"
                                Width="350"
                                VerticalAlignment="Center"
                                Minimum="0"
                                Maximum="100"
                                ShowRange="True" 
                                RangeStart="40"
                                RangeEnd="70"
                                Foreground="#FF46A4DA"
                                ShowCustomLabels="True"
                                LabelPlacement="BottomRight" RangeChanged="sliderValueChanged"/>
And in .cs I am trying to get the range end value with the following code

 private void sliderValueChanged(object sender, Syncfusion.UI.Xaml.Controls.Input.RangeChangedEventArgs e)
        {
           
                System.Diagnostics.Debug.WriteLine("Range Chnaged" + sliderFlash.RangeEnd);
         
           
        }
but every time it gives
A first chance exception of type 'System.NullReferenceException' occurred in Range Slider Test.exe
An exception of type 'System.NullReferenceException' occurred in Range Slider Test.exe but was not handled in user code
Additional information: Object reference not set to an instance of an object.

I have attached the source

Attachment: Range_Slider_Test_57a112b3.zip

1 Reply

VV Vignesh V Syncfusion Team May 23, 2014 10:15 AM UTC

Hi Souvick,

 

We would like to inform that the reported issue occurs, because the control is not loaded initially. SfRangeSlider is loaded after ValueChanged event, that makes the instance empty. We have modified your sample that tries to meet your reuirement of getting RangeEnd value in ValueChanged event.

 

Please find the sample in below link,

Range_Slider_Test.zip

 

Please let us know if you have any queries.

 

Regards,

Vignesh V


Loader.
Live Chat Icon For mobile
Up arrow icon