how to format the text in textbox dy getting the format

Posted by Raj_Chennai under WPF on 10/23/2013 | Points: 10 | Views : 910 | Status : [Member] | Replies : 4
when a user provides the input to the textbox as 12345667 ,i need to convert this data into standard currencyformat

raj


Responses

Posted by: Bandi on: 10/23/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer
http://stackoverflow.com/questions/9910681/textbox-with-currencyformat-and-propertychanged-trigger-doesnt-accept-text-righ
http://stackoverflow.com/questions/13818515/how-to-convert-number-to-currency-format-using-wpf-and-c-net

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Raj_Chennai, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 10/23/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
<Style TargetType="{x:Type TextBox}">
<Setter Property="Text" Value="{Binding SomeValue, StringFormat=C }" />
<Style.Triggers>
<Trigger Property="IsKeyboardFocusWithin" Value="True">
<Setter Property="Text" Value="{Binding SomeValue, UpdateSourceTrigger=PropertyChanged}" />
</Trigger>
</Style.Triggers>
</Style>


Reference for getting String Formats for currency:
http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Raj_Chennai, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 10/29/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Click on "Mark as answer"

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Raj_Chennai, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: WPF_G on: 11/5/2013 [Member] Starter | Points: 25

Up
0
Down
You can find more information, a guide and great examples at the following link:
http://tekkiebooks.com/Product/9db79251-4ddb-42c5-819e-873cce0f4d5f/dotnetfunda_02

For me it was a great guide!
Good luck!

Raj_Chennai, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response