Hi
I have used XamNumericEditor and XamCurrencyEditor to display values in particular format like "Format=.000000"
Initially the format of value should not be displayed when we open the window.
After that,when the textbox is focused then it should display the format of value in the textbox.
Please find the attached file for clear picture.
Hi Saravanan,
I used your xaml and made a few changes. I think I ended up with what you want. I also add a xamNumericEditor for the Quantity property. You should include a ValueType reference there if your data is not of the default Double type.
<TextBlock Text="Contract Value:" Grid.Row="0" Grid.Column="0"
HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3,0,0,0"></TextBlock>
<igWPF:XamCurrencyEditor Grid.Row="0" Grid.Column="1" Width="120"
HorizontalAlignment="Left" VerticalAlignment="Center"
Margin="5,3,0,3"
Mask="{}{double:-15.3}" Format="##,###,###.###"
DisplayMode="Raw" DataMode="Raw"
HorizontalContentAlignment="Right"
Text="{Binding ContractValue}"
IsEnabled="{Binding IsContractValueEnable}"/>
<TextBlock Text="Quantity:" Grid.Row="1" Grid.Column="0" Margin="3,0,0,0"
HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
<igWPF:XamNumericEditor Grid.Row="1" Grid.Column="1" Width="80"
HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,3,0,3"
InvalidValueBehavior="RevertValue"
PromptChar=""
Text="{Binding Quantity}"
ValueType="{x:Type sys:Int16}"
Mask="###" Format="###" >
</igWPF:XamNumericEditor>
<TextBlock Text="Premium Rate:" Grid.Row="2" Grid.Column="0" Margin="3,0,0,0"
<igWPF:XamNumericEditor Grid.Row="2" Grid.Column="1" Width="80"
Mask="{}{double:-2.6}" Format=" %"
DisplayMode="IncludeLiteralsWithPadding" DataMode="Raw"
Text="{Binding PremiumRate}"
IsEnabled="{Binding IsPremiumRateEnable}"
TabIndex="70">
<!-- I removed your reference to the SpinIncrement
SpinIncrement="0"
-->
<igWPF:XamNumericEditor.ValueConstraint>
<igWPF:ValueConstraint Nullable="False"/>
</igWPF:XamNumericEditor.ValueConstraint>
Let me know if this helps.
Hi Marianne
Your solution was helpful to some extent. I have queries for few more functionalities.
Kindly find the attached file for more details.
Regards
I’ll attach a sample that is based on what I was trying to explain. Normally the Mask is used to format the control in edit mode. And Format is used to handle the control in display mode.
Because you have a variety of requirements, I added ValueToDisplayTextConverters for the controls showing the Contract Value and the Premium Rate.
You’ll see that I used XamCurrencyEditors, XamMaskedEditors and XamNumericEditors with similar results. I tried to add captions so you can see where each control type is being used. Since you aren't using the CurrencyEditor to show currency, I would recommend that you use the XamMaskedEditor.
Please let me know if you have any questions.
You have given solution in WPF4 version. But I am using WPF3 V12.1.
I will be thankful if you provide the solution in WPF3 V12.1
Hi Ramya,
I'm attaching a modified sample for 3.0 framework and NetAdvantage 2012.1. I needed to make some changes, removing the Input control and the ValueType property from the Editors. I also made some modifications to the converters because the MaskEditor is passing a string and not a decimal.
Hello,
Do you have any other questions on this matter?
Sincerely,
Valerie
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
Thanks for the solution.Its working fine