This is a migrated thread and some comments may be shown as answers.

RadMaskedTextBox EmptyContent Issue

1 Answer 24 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shane Woodward
Top achievements
Rank 1
Shane Woodward asked on 17 Mar 2011, 02:48 AM
I am using the RadMaskedTextBox in a binding scenario (real simple). And I set the EmptyContent property to "" as my datasource allows null values for the field. The setting of the EmptyContent for the null value works for the first time I open the childwindow, but for the second time I cannot edit inside the RadMaskedTextBox. No keystrokes are accepted. Is this a know bug or am I missing something that I don dot know?

Here my UI stuff:

<telerik:RadMaskedTextBox Width="100" x:Name="txtGrossPay" Grid.Row="24" Margin="165,2,478,2" MaskType="Numeric" Mask="n2" VerticalAlignment="Center" ValueChanging="balances_ValueChanging" SelectionOnFocus="SelectAll" EmptyContent=""></telerik:RadMaskedTextBox>

Here my code behind for the binding:

txtGrossPay.SetBinding(RadMaskedTextBox.ValueProperty, new Binding("BalancesUI.GrossPay") { Mode = BindingMode.TwoWay});

1 Answer, 1 is accepted

Sort by
0
Alex Fidanov
Telerik team
answered on 17 Mar 2011, 04:35 PM
Hello Shane Woodward,

Just to be clear on this, the EmptyContent property acts as a watermark text when the RadMaskedTextBox is empty. If you set it to null, then you would never be able to see it, no matter whether the control is empty or not. You would rather want to use this property to display some prompting text like "Enter value here". Please also note that the RadMaskedTextBox does not support null values.

I tried to reproduce the behavior that you described but I was not able. Could you please provide more details on your setup (the child window) and when you set the Binding.

All the best,
Alex Fidanov
the Telerik team
Tags
General Discussions
Asked by
Shane Woodward
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Share this question
or