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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Initial value

Thread ID:

Created:

Updated:

Platform:

Replies:

125953 Sep 14,2016 01:23 PM UTC Oct 10,2016 01:05 PM UTC UWP 5
loading
Tags: SfNumericTextBox
Francis
Asked On September 14, 2016 01:23 PM UTC

Hi,

For some reason when I load up any of my pages the numeric text boxes do not show the value with the correct format until I click on the box and enter a new value.
However if I set the culture of the text box the it displays the formatting but no longer shows a value of 0 in the box.
Here is an example of my XAML:

<sync:SfNumericTextBox Header="Cost:" Text="{x:Bind ViewModel.Marketing.Cost, Mode=TwoWay, Converter={StaticResource StringToDouble}}" FormatString="C" Culture="{x:Bind ViewModel.culture}" InputScope="Number"/>

The same issue occurs with the percentage format.
It seems strange as I haven't made any changes to these controls but they are no longer working as they did yesterday.
I even rolled back my code to check and it still doesn't work.

Regards

Francis

Priyanga Balasubramaniam [Syncfusion]
Replied On September 15, 2016 01:05 PM UTC

Hi Francis,

Thank you for Contacting Syncfusion Support.

We have checked your query, but we could not reproduce the issue at our end. Can you update us the version number which you have upgraded and also the old version you have used? If possible, please provide the sample to reproduce the issue which could help us to proceed further on this.

Regards,
Priyanga B


Francis
Replied On September 15, 2016 02:32 PM UTC

Hi,

I have done some more testing and found something interesting.

<sync:SfNumericTextBox Header="Cost:"  Text="{x:Bind ViewModel.test, Mode=TwoWay, Converter={StaticResource StringToDouble}}" Culture="{x:Bind ViewModel.culture}" FormatString="C" InputScope="Number"/>

Results in a value of £0.00 regardless of what value is set during the binding and only shows the a value in the £ format once a new value is entered.

<sync:SfNumericTextBox Header="Cost:" Culture="{x:Bind ViewModel.culture}" Text="{x:Bind ViewModel.test, Mode=TwoWay, Converter={StaticResource StringToDouble}}" FormatString="C"  InputScope="Number"/>

This code fixes this issue as the culture is set before the value binding of the text box so the value now appears in the text box unformatted e.g a value of 300 appears as 300 instead of £300.00. Again once a new value is entered the value is formatted correctly.
I tried to put the format string before the value binding however this had no effect.

I then tried using the Value property instead of Text:

<sync:SfNumericTextBox Header="Cost:" Culture="{x:Bind ViewModel.culture}"   Value="300" FormatString="C"  InputScope="Number"/>

This worked properly with the value being formatted as £300.00 when the page loaded.
The issue now however when I try to use Binding to value it doesn't work and using x:Bind makes the value property report that the "input is not in the correct format" in the designer.
Is there a way I can two way bind to the value property then I believe the issue would be resolved?
It is strange however that it the value bound to the text property was being was working until yesterday morning although I did perform an update for visual studio to version 14.025420.1 and syncfusion updated to 14.2.0.26 on the 12th, but the numeric text boxes were behaving as normal afterwards and the following day.
I'm using Windows 10 anniversary edition but my app is targeting 10586 as that is the version of the phone emulator I am testing with.

Regards

Francis




Mariappan S [Syncfusion]
Replied On September 19, 2016 12:25 PM UTC

Hi Francis, 

We were able to reproduce the issue and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates 


Please let me know if you have any questions. 

Regards, 
Mariappan S 


Eduardo Padilla
Replied On October 8, 2016 05:00 PM UTC

Hi,

Any news about this issue? I am having a similar problem where the percentage sign only shows after editing the field. Additionally, the binding does not work, no matter why I enter in the textbox it does not change value in the model. Yes, I am implementing INotifyPropertyChanged.

<my2:SfNumericTextBox x:Name="txtRate"  
                      Header="Rate"
                      Margin="0,0,10,5"
                      Width="90" 
                      ParsingMode="Decimal"
                      MaximumNumberDecimalDigits="2"                      
                      FormatString="P" 
                      PercentDisplayMode="Value"
                      MaxLength="5"
                      AllowNull="True"
                      Value="{Binding Merchant.Rate, Mode=TwoWay}"/>

The field is defined as a nullable decimal.

Regards,

Eduardo P.

Priyanga Balasubramaniam [Syncfusion]
Replied On October 10, 2016 01:05 PM UTC

Hi Eduardo,

Query#1:"I am having a similar problem where the percentage sign only shows after editing the field"

We have checked your query percentage sign appears after editing the field. This is behavior only.

Query#2:"the binding does not work, no matter why I enter in the textbox it does not change value in the model"

We have checked our SfNumericTextBox control based on the code provided in your last update and we were unable to reproduce the reported behavior from our side. From your code, we suspect that you may not include the “UpdateSourceTrigger as PropertyChanged” while binding the value. We have prepared sample for your reference and it can be downloaded from the below location

Sample : SfNumericTextBoxBind 

Please let us know, if we misunderstood your query. If so, can you please provide the more details about the reported behavior which helps us to provide the solution at earliest.

Regards,
Priyanga B
 


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.

Warning Icon 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.Close Icon

;