RadMaskedTextBox EmptyContent Issue

2 posts, 0 answers
  1. Shane Woodward
    Shane Woodward avatar
    13 posts
    Member since:
    Jan 2010

    Posted 16 Mar 2011 Link to this post

    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});

  2. Alex Fidanov
    Admin
    Alex Fidanov avatar
    637 posts

    Posted 17 Mar 2011 Link to this post

    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
Back to Top