SfNumericUpDown ValueChanged Changed Event Value & object of SfNumericUpDown Value is always same

Abc.xaml

  x:Name="sfnumericUpDown" 
Minimum="1" 
HeightRequest="30" 
WidthRequest="110" 
ParsingMode="Decimal" 
HorizontalOptions="Start" 
FormatString="N" 
SpinButtonAlignment="Both"
SpinValidation = "Default"
MaximumDecimalDigits="0"
Grid.Column="1" 
ValueChanged="OnQuantityValueChanged"/>            

Abc.xaml.cs

void OnQuantityValueChanged(object sender, ValueEventArgs e)
{
          SfNumericUpDown numericUpDown = sender as SfNumericUpDown;
          var updatedValue  = e.Value;
          var  InitialValue = numericUpDown.Value;
          // here e.value & numericUpDown.value is always same in Android, its perfect working for iOS
}


Here,
When user click on +/- tick marks, the component calls OnQuantityValueChanged method.
This method behaves differently in both (iOS and Android)

Let me give an example.:
SfNumericUpDown have initial value is 10. User clicking on + tick mark.

In iOS:
UpdatedValue = 11 and
InitialValue  = 10.

In Android:
UpdatedValue = 10 and
InitialValue  = 10.

WHY IT IS BEHAVING DIFFERENTLY IN BOTH VERSION ?
iOS behaves right behavior compare to Android.

Please suggest me the way to resolve this issue and also let me know if I am doing anyhting wrong here.
Help will be appreciated.

Thanks in Advance
Dharam.

5 Replies

PA Paul Anderson S Syncfusion Team July 5, 2018 07:21 AM UTC

Hi Dharam, 

Thank you for using Syncfusion products. 

In SfNumericUpDown, in when the ValueChanged event is fired, e.value and NumericUpDown Value property should have the same value and Android holds the correct expected behavior. This is because as the name denoted ValueChanged will be called once the Value property changes. If this should have the old value then the naming will be ValueChanging. This is similar to TextChanging and TextChanged events or Entry. 
We have considered the iOS behavior as a defect and logged a defect report. The fix will be available in our upcoming Volume 2 SP1 release which will be in the end of this July 2018. 

Please let us know if you have any concerns. 

Regards, 
Paul Anderson 



DS Dharam Sarvaiya July 6, 2018 10:47 AM UTC

Hello Paul ,

Thank you For Give Quick Response,

I have one more Query according to your answer , If User Click on "+/-" or Update Value Manually , How can we identify what is previous value controller have ?

For Example :
 If SfNumericUpDown  has Initial Value is 5 and then After User Changed Value From 5 to 7,8 (whatever except 5) , how can we get what is previous value of controller ?

Currently I get both value in iOS only.(not work in Android).

Please Suggest me if I'm on wrong Track.

Thanks 
Dharam 




PA Paul Anderson S Syncfusion Team July 9, 2018 09:20 AM UTC

Hi Dharam, 
 
Thanks for the update. 
 
Currently we don’t have support for your requirement in SfNumericUpDown to have the previous value. It should be achieved using the ValueChanging event as like Entry behavior. So, we have considered this as a feature request and added to our feature list. This feature will be available in any of our upcoming release. 
 
Meanwhile we have tried to achieve your requirement in the sample by defining a property as PreviousValue and please have the sample from the below link. 
 
 
Please let us know if you have any concern. 
 
Regards, 
Paul Anderson 



DS Dharam Sarvaiya July 9, 2018 11:58 AM UTC

Hello Paul,

Thanks for Update & Sample 

I'll review it 

Thanks
Dharam


PA Paul Anderson S Syncfusion Team July 10, 2018 04:30 AM UTC

Hi Dharam, 
 
Thanks for the update. 
 
We will wait until we hear from you. 
 
Regards, 
Paul Anderson 


Loader.
Up arrow icon