This is a migrated thread and some comments may be shown as answers.

[Solved] [RadNumericTextbox] Problem with binding of data from type "Decimal"

1 Answer 429 Views
Input
This is a migrated thread and some comments may be shown as answers.
Christophe
Top achievements
Rank 1
Christophe asked on 23 May 2008, 02:04 PM
Hello,

I used RadNumericTextbox in FormView and in RadGrid. I used the methods Select, Insert and Update to bind data in this control.
I have some problems when I'm binding a data from type "Decimal" : on the loading, the value in the RadNumericTextbox is multiplied by 100 (because my decimal type is defined with 2 decimals).
This problem occurs when I'm using Text or Value property of my RadNumericTextbox.
If I used DbValue instead on Text or Value, the loaded value in my field is the good, but when I when to update my line, I have a conversion error :
Object of type 'System.Double' cannot be converted to type 'System.Decimal'.

How can I good configure my RadNumericTextbox to use correctly decimal values to bind in the 2 ways ?

Than you in advance,

Christophe.

1 Answer, 1 is accepted

Sort by
0
Missing User
answered on 26 May 2008, 10:39 AM
Hi Christophe,

Find attached a sample project where we're using DataTable with decimal column and we're not getting any errors. Please review it and let us know what differs in your case. If you are using objectdatasource with custom fields, it would be best to open a support ticket and attach a runnable sample. We will gladly review it and get back to you with our findings.

All the best,
Plamen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Input
Asked by
Christophe
Top achievements
Rank 1
Answers by
Missing User
Share this question
or