Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi to all,

I have one TextBox, like the below...

XML
<controls:numerictextbox x:name="numquot" 
       HorizontalContentAlignment="Right"
       Style="{StaticResource NumericTextBox}"     
       Text="{Binding Path=Rate, UpdateSourceTrigger=PropertyChanged,StringFormat={}{0:C}};

</controls:numerictextbox> 


and this is my style for TextBox...

XML
<Style x:Key="NumericTextBox" TargetType="{x:Type TextBoxBase}" BasedOn="{StaticResource {x:Type TextBoxBase}}"
            </Style>


The Problem is:
When I type numerics in that is going to display as worng information.

Example : when I type 52 it is going to display like $25.00 and when I type like 129, it is going to dispaly like $921.00.

I hope you understood the problem.
Can you please help me.
Posted
Updated 10-Dec-10 0:33am
v11
Comments
E.F. Nijboer 10-Dec-10 3:22am    
Does it help if you add the attribute FlowDirection="LeftToRight"?
Tarun.K.S 10-Dec-10 3:32am    
Some problem encountered while adding <pre> tags to your question. Sorry couldn't figure it out.
Prerak Patel 10-Dec-10 3:34am    
someone please, reformat the question with <pre> tags
Dalek Dave 10-Dec-10 3:43am    
Edited for Grammar, Syntax and Code Blocks.
sandipapatel 10-Dec-10 6:55am    
Try to change

StringFormat={}{0:C} to different possiblity

1 solution

First of all, I dont see a binding that says TwoWay.
So whatever you type into the textbox your underlying datasource is not going to change.

Second make sure you are not doing changes in code that could be formatting the text inside this textbox.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900