Hello!
I want to use a NumericEditor for an int Property. In our application, to represent a null int, we use the min value of an int (int.MinValue). I'm trying to represent this particularity in the editor with a ValueToTextConverter (editing) and a ValueToDisplayTextConverter (not editing). The last code is shown below, I've tried various options (MyInt is our encapsulation of an int to represent nullables and other functions). When the value is displayed (not editing) it works fine, but when I enter in the NumericEditor to edit the value, it shows the int.MinValue (-2147483648).
I would like too, to set a max and min value for the int in order to put a range of [-100, 100] and the width of the editor to the minimum size (30) to view those values, I've tried with various masks, but it doesn't work.
Thanks a lot in advance,
Marc.
-- Code
public class IntValueToTextConverter : IValueConverter
{
// Convert gets called to convert value to text.
if (MyInt.IsInt(value) && targetType == typeof(string) && (int)value != MyInt.Null)
else
return System.DBNull.Value;//Infragistics.Windows.Utilities.ConvertDataValue(null, targetType, editor.FormatProvider, editor.Format);
}
// ConvertBack gets called to convert user input into to value.