Hi,
It seems that EditType for xamNumericEditor is double, can we change this to Int so that it will show only whole numbers without decimals.
Also I need to set this xamNumericEditor format from the CultureInfo. I tried by setting 'editor.FormatProvider = new CultureInfo("en-GB");',
but this doesnt works.
How can I achieve this through code? Can somebody help me in this regard?
Alex,
I tried the same, but it doesnt work.
My Regional setting for number as follows 123,456,789
My code as follows
xamDataGrid.Language = XmlLanguage.GetLanguage(System.Threading.Thread.CurrentThread.CurrentCulture.Name);
field.Settings.EditorType =
typeof(XamNumericEditor);
By
Ramesh.P
Try this:
var numericStyle = new Style(typeof(XamNumericEditor)); numericStyle.Setters.Add(new Setter(XamNumericEditor.FormatProperty, null)); numericStyle.Setters.Add(new Setter(XamNumericEditor.FormatProviderProperty, CultureInfo.CurrentCulture)); numericStyle.Setters.Add(new Setter(XamNumericEditor.ValueTypeProperty, typeof(double)));
field.Settings.EditorStyle = numericStyle; field.Settings.EditorType = typeof(XamNumericEditor);