I am using a xammaskededitor in a grid. When the user deletes all the chars in a cell the grid sets my string/property to null. Is there a way to have the grid set it to string.empty or "" so I don't have to check for null in my property accessor.
<Style x:Key="PhoneNumberStyle" TargetType="{x:Type igEditors:XamMaskedEditor}"> <Setter Property="Mask" Value="{}{char:20:A-D0-9#*,}" /> </Style>
<igDP:Field Name="Phone" Label="Phone"> <igDP:Field.Settings > <igDP:FieldSettings LabelWidth="90" EditAsType="{x:Type sys:String}" EditorStyle="{StaticResource PhoneNumberStyle}"> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field>
Hello,
I believe there is no such property exposed that allows this. What you can do is to set the ValueConstraing of the editor so that no null values are allowed.
Style s = new Style(typeof(XamMaskedEditor));
ValueConstraint constraint = new ValueConstraint();
constraint.Nullable = false;
s.Setters.Add(new Setter(XamMaskedEditor.ValueConstraintProperty, constraint));
xamDataGrid1.FieldLayout.Fields["X"].Settings.EditorStyle = s;