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

Nullable Types + TextMode="PlainText"

3 Answers 112 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 19 May 2011, 10:03 AM
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

3 Answers, 1 is accepted

Sort by
0
Alex Fidanov
Telerik team
answered on 24 May 2011, 09:15 AM
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
0
Sam
Top achievements
Rank 1
answered on 24 May 2011, 10:19 AM
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
0
Accepted
Petar Mladenov
Telerik team
answered on 27 May 2011, 09:39 AM
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
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Sam
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Sam
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or