NullValue is not set to textbox when RadNumericUpDown is loaded

14 posts, 1 answers
  1. Elifbars
    Elifbars avatar
    4 posts
    Member since:
    May 2010

    Posted 05 Aug 2010 Link to this post

    Hello,

    It's me again =)
    I have a question about NullValue property:
    Here is my numericUpDown control code:
    As you see i want RadNumericUpDown to show nothing in it's textbox when it's binding value is null. But when the the userControl with this numericUpDown is loaded i see the value $0.00 in it's textbox instead of "empty" string.

    <telerik:RadNumericUpDown Name="numericVMDNQRS"
                NullValue="" Value="{Binding Path=Tier.VMDNQRS,ValidatesOnDataErrors=True,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
                IsEditable="True" AutoReverse="False" Minimum="0"          
                SmallChange="0.1"
                LargeChange="1" V
                alueFormat="Percentage"
                DataContext="{Binding}"/>


    When i delete everything from textbox and it loses focus everything works well: no value appears in textbox.
    I tried to check Value property of RadNumericUpDown on Initialized and Loaded event - it's not null but 0.0.
    I also tried to inherit from RadNumericUpDown and override FormatDisplay mehtod to check the value that it get from argument, but it's also 0.0.
    So the question is how to show nothing in RadNumericUpDown textbox when it has just loaded and it's binding value is null?
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 10 Aug 2010 Link to this post

    Hello Elifbars,

    I was unable to reproduce the problem with a simple application. Could you please, verify that your data objects' property that is bound to RadNumericUpDown is nullable? A sample application that could be used to observe the problem would be of great help, though.

    Greetings,
    Valeri Hristov
    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. UI for WPF is Visual Studio 2017 Ready
  4. Elifbars
    Elifbars avatar
    4 posts
    Member since:
    May 2010

    Posted 16 Aug 2010 Link to this post

    Hello,

    This post is not the answer on my previous quiestion but it may help while working with RadNumericUpDown.
    I wrote it here by accident, because didn't notice that in my previous post property IsEditable was set to True, but now i can't delete it.
    Maybe it will be better to replace this post to another thread. Sorry.

    I have another RadNumericUpDown
    <telerik:RadNumericUpDown Name="numericMinutes"
                            IsEnabled="{Binding ElementName=chkAutoBatch,Path=IsChecked}"
                            IsEditable="False" Width="60"
                            Value="{Binding Path=AutoBatchTimeMinutes,Mode=TwoWay}"
                            Minimum="0" Maximum="50" SmallChange="10" LargeChange="10"
                            AutoReverse="True"
                            IsInteger="True" ValueFormat="Numeric"/>

    The problem was that after loading it's value was always 0, even i had changed it's value before.

    Solution:
    As you can see IsEditable is set to False. After I set IsEditable to True it's value binding started to work as it should. So the problem was in property IsEditable=False which prohibits to change RadNumericUpDown value when it loads.

    What concerns NullValue, so i didn't check it's behaviour because now i don't need logic with NullValue in my application.
  5. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 19 Aug 2010 Link to this post

    Hello Elifbars,

    This is a known problem and it is already resolved. You should download the latest version of our controls (SP1). Here is the link to the fixed bug in PITS: http://www.telerik.com/support/pits.aspx#/public/silverlight/1645

    Sorry for the caused inconvenience, let me know if you have further questions.

    All the best,
    Boyan
    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
  6. Elifbars
    Elifbars avatar
    4 posts
    Member since:
    May 2010

    Posted 01 Sep 2010 Link to this post

    Hi, Boyan 
    You replied: "This is a known problem and it is already resolved."

    Do you mean problem when after loading value is always 0 if IsEditable=False or NullValue issue (when the value of NumericUpDown is 0.0 even binding value is null and NullValue="")?
  7. Answer
    Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 06 Sep 2010 Link to this post

    Hello Elifbars,

    Both problems should be fixed now. However if you still have problems with the latest version please let us know. We will be glad to help.

    Sincerely yours,
    Boyan
    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
  8. Saulius Kundrotas
    Saulius Kundrotas avatar
    4 posts
    Member since:
    May 2010

    Posted 07 Oct 2010 Link to this post

    When Min property is specified in xaml - binding to Value is ignored in latest WPF controls? I see bug was fixed in silverlight controls but it seems not fixed for WPF control? My properties specified on control -

    IsEditable

     

     

    ="True" IsInteger="True" ValueFormat="Numeric" Maximum="400" Minimum="10" SmallChange="5"

     

    and binding to Value property. Control resides in DataTemplate and DataTemplate is used to render ViewModel.

    Thanks
  9. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 13 Oct 2010 Link to this post

    Hi Saulius Kundrotas,


    Sorry for the late reply. We managed to reproduce the issue. It is very strange that if the numeric is not in DataTemplate the binding is working fine. Also if the Minimum is a negative value  binding is working fine as well. But in your scenario it is not. I have entered this bug in our Public issue tracking system. You can follow the PITS Issue progress by its ID: 3711

    Thank you for your report. I have updated your Telerik points.

    All the best,
    Boyan
    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
  10. Mark
    Mark avatar
    2 posts
    Member since:
    Jun 2010

    Posted 09 Nov 2010 Link to this post

    I couldn't locate this issue regarding the Minimum property causing the control not to bind in the PITS.

    Is it in the schedule?

    Is there workaround?
  11. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 12 Nov 2010 Link to this post

    Hello Mark,

    Sorry I have given you a wrong link. This is the link to the entry in PITS: http://www.telerik.com/support/pits.aspx#/public/wpf/3711. As a workaround you can just not use a DataTemplate.

    Don't hesitate to contact us if you have further questions.

    Sincerely yours,

    Boyan
    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
  12. Mark
    Mark avatar
    2 posts
    Member since:
    Jun 2010

    Posted 12 Nov 2010 Link to this post

    Thanks. I can see it is not scheduled for Q3.  This should be an easy fix on your end.  It seems like a typo.  Can it be worked into Q3?

    My design is heavily dependent on data templates.  This pretty much makes the control unusable for any enterprise app requiring a minimum bound > 0.

    Any other workaround?

    Mark
  13. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 17 Nov 2010 Link to this post

    Hi Mark,

      This fix didn't make it for the Q3 release. We investigated it We will do our best to fix it for next week's internal build. Hope this is acceptable for you.

    Sorry for the inconvenience caused. Let me know if you have further questions.

    Sincerely yours,
    Boyan
    the Telerik team
    See What's New in RadControls for WPF in Q3 2010 on Tuesday, November 16, 2010 11:00 AM - 12:00 PM EST or 10:00 PM - 11:00 PM EST: Register here>>
  14. Biff
    Biff avatar
    1 posts
    Member since:
    Feb 2012

    Posted 29 Mar Link to this post

    Hello,

    I think this is related. I have a RadNumericUpDown with currency and a Viewmodel binding. The currency property is bound to a nullable decimal value. When the view intializes with a null decimal, nothing is displayed, which is correct. If there is already a decimal value, i cannot seem to remove the value (remove all text in the input). No matter how i try to delete the value, the value remains the same as soon as the RadNumericUpDown looses focus. I have the same setup for a nullable double property that is also bound to a RadNumericUpDown, which works fine when deleting the value (making it null in the viewmodel)

    Here is my ViewModel property that i bind the RadNumericUpDown control to:

     

    private decimal? currencyValue;

            public decimal? CurrencyValue
            {
                get { return currencyValue; }
                set {
                    currencyValue = value;RaisePropertyChanged("CurrencyValue");
                }
            }

    View:

    <telerik:RadNumericUpDown x:Name="currencyWidget" ValueFormat="Currency" Value="{Binding CurrencyValue}" NullValue="" />

    Any help would be greatly appreciated,

    Biff

  15. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 30 Mar Link to this post

    Hi Biff,

    I have tested the explained scenario, but wasn't able to reproduce the issue  - I was able to delete the value inside NumericUpDown without a problem. Is it possible for you to send us a small runnable demo where the issue can be replicated? Please note that you should open a support ticket and attach it there.

    Thanks in advance.

    Regards,
    Yana
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for WPF is Visual Studio 2017 Ready