[英]How to insert a decimal value to money data type column with wpf C# and Ado.Net Data Entity
I'm trying to save prices for products from a textbox. 我正在尝试通过文本框节省产品价格。 I know I have to convert or parse the input into decimal datatype. 我知道我必须将输入转换或解析为十进制数据类型。 Now I have two question about this: 现在我有两个问题:
Hope my questions are clear! 希望我的问题清楚!
It sounds like you need a style for your TextBoxes. 听起来您需要TextBoxes的样式。 Here's a basic style that should provide you with enough information to research the terms included so you can alter it to act how you want. 这是一种基本样式,应为您提供足够的信息来研究所包含的术语,以便您可以根据自己的意愿进行更改。 You may need to bind a Path. 您可能需要绑定路径。
<Style x:Key="MoneyStyle" TargetType="{x:Type TextBox}">
<Setter Property="Text" Value="{Binding StringFormat='###,###.##'"/>
</Style>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.