Hello,
I'm not able to find the solution of this. I would like to have a XamNumericEditor where the data type is double and the minimum/maximum can be set.
I use NetAdvantage WPF 2012.2. The documentation say there are Minimum and Maximum properties (http://help.infragistics.com/Help/NetAdvantage/Silverlight/2012.1/CLR4.0/html/InfragisticsSL5.Controls.Editors.v12.1~Infragistics.Controls.Editors.XamNumericEditor_members.html). But with "2012.2" there aren't such kind of properties.
So I tried to set it with "Mask" (http://help.infragistics.com/Help/NetAdvantage/WPF/2011.1/CLR4.0/html/xamEditors_Masks.html) in this way:
<igWPF:XamNumericEditor x:Name="MyEditor" Grid.Row="1" Grid.Column="2" Width="80" SpinButtonDisplayMode="Always" Theme="IGTheme" Value="0" Mask="{}{double:4.1}{number:0-255}">
But this doesn't work.
The requirements are as follow:
- The data type should be double and min/max are set to the XamNumericEditor.
- If the user sets a higher value than the maximum, XamNumericEditor should clip the value to the maximum.
- If the user sets a lower value than the minimum, XamNumericEditor should clip the value to the minimum.
- The validation process should start after the user clicks the enter key.
Please have a look at the attached project, where I tried to implement these requirements into the "X Axis Display Maximum and Minimum". You can try it be setting the Maximum x Display value to 9999. The value should be clipped to 850.
Who can help me in this case?
Regards,
Thomas
Hi,
The doubleUpDown from WPF Toolkit (http://wpftoolkit.codeplex.com/wikipage?title=DecimalUpDown&referringTitle=NumericUpDown-derived%20controls) is nearly perfect.Positive:The maximum and minmum can be set.The validation starts after the user hits the enter key.The spin buttons are correctly en-/disabled if the boundary is reached.Negative:The current value won't be clipped if the boundary is reached.
Here is an example how easy doubleUpDown can be used:
<xctk:DoubleUpDown x:Name="XMinDoubleUpdown" Grid.Row="1" Grid.Column="1" FormatString="F1" HorizontalAlignment="Center" Height="25" Width="80" FontSize="14" Value="{Binding ActualMinimumDisplayValue}" Increment="1.0" Maximum="{Binding ActualMaximumDisplayValue}" Minimum="{Binding ActualMinimumValue}" />
@Infragistics: It would be great if you can implement such behaviour in your control.
Greetings,
You can try to use the xamNumeric's ValueConstraints. They can be used like that:
<igWPF:XamNumericEditor.ValueConstraint> <igWPF:ValueConstraint MinInclusive="100" MaxInclusive="850"></igWPF:ValueConstraint> </igWPF:XamNumericEditor.ValueConstraint>
And if a user enters somehow a number outside of this boundary, you can hook up to ValueChanged event. And inside check if the value is correct with IsValueValid property. If it's valid - use the e.NewValue, else - use the e.OldValue, to set xamNumeric's value
Anastas