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

[URGENT] When null showing ___.__

9 Answers 279 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 02 Apr 2012, 09:32 AM
Hello,
I've a RadMaskedNumericInput with the mask  Mask="#9.4", I want to show _____.__ when the page loads up (null value binded) but I got ____0.00 why?

Thanks

9 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 04 Apr 2012, 12:37 PM
Hello Paolo,

The default value of the RadMaskedNumericInput control is 0 and this is why it is displayed when the control is initialized. But if you want to change the default Value to null, you can bind it to a nullable double business property which initial value is null. Or if you don't want to use databinding you can set the Value to null in xaml: Value="{x:Null}". Give this a try and let us know if it helps.

On a side note, I just wanted to encourage you to take advantage of the support ticketing system (http://www.telerik.com/account/support-tickets/new-support-ticket.aspx) in cases when you need a prompt response to urgent issues. This is the best way to reach our support staff - the support system assigns a response time for all of your questions, depending on your license and ensures that all questions will reach the respective developers, if needed.

All the best,
Tina Stancheva
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Stephen Tearle
Top achievements
Rank 2
answered on 18 Apr 2012, 08:14 AM
Hi,

Binding a RadMaskedNumericInput to a nullable double? property indeed works correctly as described above... however, when binding to an int? the control displays '0' even when the bound property value is null.

I also tried binding to float? and decimal? with the exact same result. Only double? properties appear not to default to '0' for null values.

Is this a bug?

Thanks,

0
Tina Stancheva
Telerik team
answered on 20 Apr 2012, 04:16 PM
Hi Stephen,

This is indeed a bug, so I logged it in our PITS where you can track its progress. I also updated your Telerik account for bringing this issue to our attention.

Greetings,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Mike
Top achievements
Rank 1
answered on 03 May 2012, 12:25 PM
Good Morning,

I am having the same issue. Could you please indicate when this bug will be fixed?

Thanks,

Mike
0
Tina Stancheva
Telerik team
answered on 03 May 2012, 02:55 PM
Hello Mike,

We will do our best to fix this issue for the Q2 2012 official release scheduled for the middle of June. I hope this time-frame is acceptable for you.

Kind regards,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Mike
Top achievements
Rank 1
answered on 03 May 2012, 07:30 PM
Hello Tina,

Thanks for letting me know. At the moment I am working round the issue by using an int? to double? converter but It would be great if this could be included in Q2 as it's not the prettiest solution.

Thanks,
Mike
0
Ankur
Top achievements
Rank 1
answered on 06 Jan 2015, 05:52 PM
Hi Tina,

Is this issue resolved? I am facing a similar situation with RadMaskedNumericControl where I am binding it to a nullable decimal and it is displaying 0 instead of blank.

I am using v2013.3.1204.45

Thanks,
Ankur
0
Martin Ivanov
Telerik team
answered on 09 Jan 2015, 12:40 PM
Hi Ankur,

The logged issue is marked as resolved but actually we have not introduced any changes in our code. Thi is because the RadMaskedNumericInput's Value property is of type nullable double (Double?) and when it is bound to nullable Int there is no framework mechanism to automatically match the null value from the set (null or decimal} to the property's type value (null or double). This is why 0 is displayed - the default value of the MaskedNumericInput's Value which is dependency property.

To resolve this you can change the bound value's type to nullable Double. You can also consider using RadMaskedCurrencyInput which Value's type is nullable Decimal or use an IValueConverter that converts the Decimal? from your view model to Double? and vise versa.

I hope this helps.

Regards,
Martin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Ankur
Top achievements
Rank 1
answered on 09 Jan 2015, 01:41 PM
Thanks Martin for coming back, I resolved it using a converter.

Best,
Ankur
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Michele
Top achievements
Rank 2
Answers by
Tina Stancheva
Telerik team
Stephen Tearle
Top achievements
Rank 2
Mike
Top achievements
Rank 1
Ankur
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or