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'm not sure how you could eliminate the zero ahead of the decimal point once the control enters edit mode. At that point you still want to include commas and whether you use Mask ="{}{double:-15.6}" or something more like Mask="{}nnn,nnn,nnn,nnn,nnn,nnn.nnnnnn", once the control is in edit mode it shows the initial zero ahead of the decimal.
As for the way the text is displayed I worked with a ValueToDisplayTextConverter and created the look I think you want. I’ll attach my converter to the response.
Please let me know if you have any further questions.
Thanks for the solution.Its working fine
Hello,
Do you have any other questions on this matter?
Sincerely,
Valerie
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
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.
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
I am unable to open the solution provided by you because of some version problem.So i opened the individual files and added the file ValueToDisplayTextConverter.cs to my application .But i found some errors when i build the solution
Kindly find the attachment for details
Ramya