Nullable Types + TextMode="PlainText"

4 posts, 1 answers
  1. Sam
    Sam avatar
    19 posts
    Member since:
    May 2009

    Posted 19 May 2011 Link to this post

    Hi There,

    I am not sure whether it is the default behavior or not, but it seems strange to me. It happens to all MaskedInput control types.

    When I set the binded value to null and the TextMode is in PlainText, parts of the mask still shows.  You can see in the screen shot the:
    • MaskedDateTimeInput still shows the dashes
    • MaskedNumericInput still shows the comma
    • MaskedCurrencyInput still shows the currency symbol and comma
    • MaskedTextInput still shows the custom characters.

    note: comma is the decimal separator here.

    what I was expecting is that when the underlying value is null, nothing will show when using PlainText (maybe even MaskedText aswell).

    I am using version 2011.1.419.1040.

    here is the Xaml:
    <telerik:RadMaskedNumericInput Margin="160,64,-4,54"
                                   HorizontalAlignment="Stretch"
                                   IsEnabled="{Binding IsEnabled}"
                                   d:LayoutOverrides="Height"
                                   Mask="#3.6"
                                   FormatString="{}{0:N6}"
                                   TextMode="PlainText"
                                   Value="{Binding DecimalValue, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnNotifyDataErrors=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"
                                   AutoFillZeros="False"
                                   UpdateValueEvent="LostFocus" />
    <telerik:RadMaskedCurrencyInput Margin="160,0,-4,26"
                                    VerticalAlignment="Bottom"
                                    IsEnabled="{Binding IsEnabled}"
                                    HorizontalAlignment="Stretch"
                                    TextMode="PlainText"
                                    Value="{Binding DecimalValue, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnNotifyDataErrors=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" />
    <telerik:RadMaskedDateTimeInput HorizontalAlignment="Stretch"
                                    Margin="160,36,-4,0"
                                    IsEnabled="{Binding IsEnabled}"
                                    TextMode="PlainText"
                                    VerticalAlignment="Top" />
    <telerik:RadMaskedTextInput HorizontalAlignment="Stretch"
                                Margin="160,0,-4,-2"
                                IsEnabled="{Binding IsEnabled}"
                                VerticalAlignment="Bottom"
                                TextMode="PlainText"
                                Value="{Binding StringValue, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnNotifyDataErrors=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"
                                Mask="(l)'l''l" />



    if this is the default behaviour, please let me know if there is a way to show nothing when the underlying value is null and its set to plaintext.

    thanks

    Sam
  2. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 24 May 2011 Link to this post

    Hello Sam,

    This should not be the default behavior. When the control is empty (the value is null) the EmptyContent will be used instead of the text. I tested your code on my end and it worked as expected. Is it possible to provide a project that we can run to observe this issue?

    All the best,
    Alex Fidanov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Sam
    Sam avatar
    19 posts
    Member since:
    May 2009

    Posted 24 May 2011 Link to this post

    Hi Alex,

    I was re-reading the post, and forgot to mention that this happens when the control is disabled.

    So the behavior is that when it is disabled, the empty content doesn't show, and it gets to the state that i have in the screen shot.  I have just tested this again, and it doesn't matter whether the control is initialized with IsEnabled="False" or set programmatically later.

    I would love to attached the project, but don't know how to, because the attach at the bottom only accepts images.

    Sam
  5. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 27 May 2011 Link to this post

    Hello Sam,

    We are still unable to reproduce this at our side. Could you please check out my attached project ( it uses Q1 2011 SP1 0419) and let me know if I am missing something? Thank you for your cooperation.

    Best wishes,
    Petar Mladenov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top