Hi everyone,
I have an issue in setting the property "Format" for xamnumeric editor in the xamdatagrid.I want to display as well as accept a number in the format "12 345 678" instead of "12345678" i have set the Format Property value as "### ### ###". Now the problem is, though the number is displaying in the format i desired, but the control is not accepting "0" as user input,i.e., "0" is not displaying in the screen.Here is the part of code.
<Style TargetType="{x:Type igEditors:XamNumericEditor}"><Setter Property="Mask"
Value="-nnnnnnnnn" />
<Setter Property="ValueType"
Value="{x:Type sys:Double}"/>
<Setter Property="Format"
Value="### ### ###"/>
</Style>
Can anyone help me in this?
Hi SRINIVAS STP,
Were you able to resolve your issue? Let me know if you still need assistance on this.
Aplogies Mr.Anastas.There was a mistake from my side in the implementation. I will udate you the status soon.Thank you
Thank you very much Mr.Anastas for your response, among the two ideas you suggested, the second option is not giving me the expected output. I couldn't reproduce the first idea. Please can you elaborate the first idea, writing the code in the code behind?..As i am new to WPF I couldn't reproduce your first suggestion. Thank you
Have you had a chance to try out Anastas' suggestion. Let us know if you have any further questions.
Hello,
Which version of WPF product you are currently using(it looks like: 12.2.1000). You can try another way, set the FormatProvider in code-behind like this: [YourNumericEditor].FormatProvider = new CultureInfo([CurrentCulture].Name) { NumberFormat = new NumberFormatInfo() { NumberGroupSeparator = " " } };
instead of set the Format property in XAML.
You can set it also in XAML by changing the Format setter to:
<Setter Property="FormatProvider" Value="{StaticResource al}"></Setter>
Where al is:
<glob:NumberFormatInfo x:Key="al" NumberGroupSeparator=" "></glob:NumberFormatInfo>
and glob is this namespace:
xmlns:glob="clr-namespace:System.Globalization;assembly=mscorlib"
Regards,
Anastas