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.

Convert Value

Thread ID:

Created:

Updated:

Platform:

Replies:

130345 May 8,2017 08:41 AM May 15,2017 01:33 AM WPF 6
loading
Tags: DoubleTextBox
Benjamin Siegmund
Asked On May 8, 2017 08:41 AM

Hello Everyone,

we got a problem which we are currently working on.
We want to use a DoubleTextBox or a similar WPF-Element.
The Issue is:

The user should be able to type 345 in the field and it got automatic corrected to 3.45
If he types 35 it should be 0.35
If he types 4.56 it should be 4.56
So far we implemented a Converter for the binding which do this very well.
But if the value is entered through database as a decimal value like 300 which ist 300.00
the converter look for the point "." -> didn't find it and place one so 300 is now 3.00
This is wrong. 
If the database value is 312.45 it works well. The decimal cut off all zero digits :/

We are currently not able to use our converter for this.

Does anyone has an idea for our problem? Is there a WPF-Element from syncfusion which does this so far?

Vinothini [Syncfusion]
Replied On May 9, 2017 03:16 AM

Hi Benjamin, 
 
From your update, we could find that you are trying to parse values with two decimal digits. Also you have reported that issue occur only when passing the value from database, we believe that handling the database value in convertor will meet your requirement. Can you share us the convertor which you have used? 
 
We can try it and provide you a solution. 
 
Regards, 
Vinothini.R 


Benjamin Siegmund
Replied On May 9, 2017 04:39 AM

Hello Vinothini,

thanks for your reply.
I added a sample project to show you my problem.
In the MainWindow you have 2 fields.
A standard textbox and a doubletextbox.
In the standard textbox you can see that there is a binding value of 23. This should be 23. The converter correct it to 0,23 what is wrong.
If you type 27 in the textbox you get the correct 0.27 and if you type 2700 you get the correct 27,00. 
So in the Doubletextbox the value 24 is displayed correct but if you type anything else it gets null.

I hope you can understand my problem. 

Thank you.

Attachment: Sample_ec8557d3.zip

Vinothini [Syncfusion]
Replied On May 10, 2017 12:42 PM

Hi Benjamin, 
 
Thank you for your update. 
 
We have checked your converter and we could find that in convertback you have checked for the Decimal and string type for targetType object. But the value passed from the DoubleTextBox is not of that type and hence null value is returned. We have modified your sample and it is available in below location. 
 
 
For the issue related to the zeroes after the decimal getting cut off, we are analyzing on that and we will update you the details before the end of 11th May,2017. 
 
Regards, 
Vinothini.R 


Vinothini [Syncfusion]
Replied On May 11, 2017 08:16 AM

Hi Benjamin, 
 
In the below stackoverflow link, you have mentioned that the solution works on your side. 
 
 
Please let us know if you need any further assistance on this. 
 
Regards, 
Vinothini.R 
 


Benjamin Siegmund
Replied On May 12, 2017 05:47 AM

Thanks a lot. Our problem is solved with your solution for the SF Doubletextbox.
The problem was fixed for the normal textbox by the code in stackoverflow.

Best regards

Priyanga Balasubramaniam [Syncfusion]
Replied On May 15, 2017 01:33 AM

Hi Benjamin,

Thank you for the update.

We are glad to hear, your problem was solved at your end.

Let us know if you need any other assistance on this.

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.

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.

;