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.
Unfortunately, activation email could not send to your email. Please try again.

App crasing while trying to get rangSlider.RangeEnd value

Thread ID:

Created:

Updated:

Platform:

Replies:

116420 May 22,2014 04:21 AM May 23,2014 06:15 AM WinRT 1
loading
Tags: SfRangeSlider
Souvick Ghosh
Asked On May 22, 2014 04:21 AM

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

Vignesh V [Syncfusion]
Replied On May 23, 2014 06:15 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;