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.
Syncfusion Feedback

Error: Value could not be converted

Thread ID:

Created:

Updated:

Platform:

Replies:

128873 Feb 13,2017 08:59 PM UTC Feb 15,2017 11:17 AM UTC WPF 4
loading
Tags: CurrencyTextBox
Andy Johnson
Asked On February 13, 2017 08:59 PM UTC

Hi,
I am trying to use the CurrencyTextBox and I am getting the following error.

Value ₹ (START_DIGIT_OF_MY_AMOUNT) can not be converted

Here is my XAML

<syncfusion:CurrencyTextBox  Grid.Column="1" Grid.Row="4" Margin="10,0,0,10" x:Name="Amount" Text="{Binding model.Amount, Mode=TwoWay, NotifyOnValidationError=True, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" Validation.Error="Validation_Error" MinWidth="200" MaxWidth="400" Culture="en-IN" CurrencyPositivePattern="2" CurrencyGroupSeparator="," CurrencyDecimalDigits="2" CurrencyDecimalSeparator=".">

This field is bound to a model which is declared as double.
public double Amount { get; set; }
Can someone help me resolve this issue?

Thanks

Priyanga Balasubramaniam [Syncfusion]
Replied On February 14, 2017 08:44 AM UTC

Hi Andy,

Thank you for contacting Syncfusion Support.

We have checked your code example. You have bind the double data type property ("Amount") to Text property of CurrencyTextBox. But Text property of CurrencyTextBox data type is String. So, conversion error occurred.

To avoid this error, we have bind the "Amount" property from model class to Value property of the CurrencyTextBox.

Please download the sample from the below location.

Sample:TestWPFApp

Regards,
Priyanga B.

Andy Johnson
Replied On February 14, 2017 08:51 PM UTC

Priyanga,
Thanks for your code.
In your example and even in my code, when view loads first, it has a Dollar sign ($) instead of a rupee sign. That is not a correct behavior. As soon as you start typing it changes to a rupee sign. Is there any way to fix that?

Thanks

Andy Johnson
Replied On February 14, 2017 10:06 PM UTC

Priyanga,
Thanks for your code.
In your example and even in my code, when view loads first, it has a Dollar sign ($) instead of a rupee sign. That is not a correct behavior. As soon as you start typing it changes to a rupee sign. Is there any way to fix that?

Thanks

I also want to start with an empty textbox. As soon as user starts typing, the rupee sign and the amount that they are typing will be appeared.
Is it possible?

Priyanga Balasubramaniam [Syncfusion]
Replied On February 15, 2017 11:17 AM UTC

Hi Andy,

Thank you for your update. Please find the response below for your queries.

Quer#1:"when view loads first, it has a Dollar sign ($) instead of a rupee sign. That is not a correct behavior. As soon as you start typing it changes to a rupee sign"

We were able to reproduce the issue from our side. A support incident has been created to track the status of this issue under your account. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents  

Quer#2:"I also want to start with an empty textbox. As soon as user starts typing, the rupee sign and the amount that they are typing will be appeared.
Is it possible?"

We have modified the last updated sample to meet your requirement. In this sample, we have enabled "UseNullOption" property of CurrencyTextBox to allow null value.

Please download the sample from the below location.

Sample:TestWPFApp

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

;