Hello,
I would like to get rid of the PromptChar in the NumericField. When using ' ', it is not visible but when I click in the cell, you can see that the spaces are highlighed. I am adding these fields in Code Behinde.
When using .PromptChar = null, the default char _ is used. Is there any way to hide the promptchar at all?
Here is my Code:
string fieldName = infeedConfig.InfeedConfigId.ToString(); string fieldLabel = string.Format("{0} [{1}]", infeedConfig.DisplayName, infeedConfig.DisplayUOM); Infragistics.Windows.DataPresenter.NumericField fieldAdd = new Infragistics.Windows.DataPresenter.NumericField(); fieldAdd.Name = fieldName; fieldAdd.Label = fieldLabel; fieldAdd.PromptChar = ' '; fieldAdd.TrimFractionalZeros = true; fieldAdd.Format = "0.###"; fieldAdd.SpinButtonDisplayMode = Infragistics.Windows.Editors.SpinButtonDisplayMode.Always; fieldAdd.SpinIncrement = 1; _infeedValuesFields.Add(fieldAdd); grdInfeed.FieldLayouts[0].Fields.Add(fieldAdd);
In XAML I can use the following code as workaround to hide it at all:
<igWPF:NumericField Name="COL_Minor" Width="100" Format="0.##" Label="{x:Static l:lang.DefectGroupStatisticSettings_Group_Minor}"> <igWPF:NumericField.PromptChar> <sys:Char></sys:Char> </igWPF:NumericField.PromptChar> </igWPF:NumericField>
<igWPF:NumericField Name="Price" TrimFractionalZeros="True" SpinButtonDisplayMode="Always" SpinIncrement="1" Format="0.###"> <igWPF:NumericField.Settings> <igWPF:FieldSettings EditAsType="{x:Type sys:Double}"> <igWPF:FieldSettings.EditorStyle> <Style TargetType="{x:Type igWPF:XamNumericEditor}"> <Setter Property="PromptChar" Value="" /> </Style> </igWPF:FieldSettings.EditorStyle> </igWPF:FieldSettings> </igWPF:NumericField.Settings> </igWPF:NumericField>
NumericField mileageField = new NumericField(); priceField.Name = "Mileage"; priceField.TrimFractionalZeros = true; priceField.SpinButtonDisplayMode = SpinButtonDisplayMode.Always; priceField.SpinIncrement = 1; priceField.Format = "0.###"; Style numericEditorStyle = new Style(typeof(XamNumericEditor)); numericEditorStyle.Setters.Add(new Setter(XamNumericEditor.PromptCharProperty, "")); FieldSettings pfFieldSettings = new FieldSettings(); pfFieldSettings.EditAsType = typeof(Double); // First option - assign the programmatically created style pfFieldSettings.EditorStyle = numericEditorStyle;
// Second option - style is defined in xaml, in the grid's resouces, assign it here pfFieldSettings.EditorStyle = this.xdg1.Resources["XNEStyle"] as Style;