Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > NumericUpDown > UI value not updated

Not answered UI value not updated

Feed from this thread
  • xp avatar

    Posted on Nov 29, 2011 (permalink)

    In my WPF application, I have  NumericUpDown like that

    <telerik:RadNumericUpDown Margin="0, 4, 0, 4"  Value="{Binding MyValue, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Maximum="{Binding MaxWidthValue}" IsEnabled="{Binding IsPropertyEnabled}"/>  MyValue is changed from data.

    The problem is :

    If this RadNumericUpDown has focus, the UI value does not change even though MyValue changed in Data. As soon as Tab out from this control, UI will change immediately.

    If this control does not have focus, the UI displayed value will change instantly as MyValue changes.


    Reply

  • Posted on Jan 23, 2012 (permalink)

    Since I have the same problem I want to know if there is a solution / workarund for this.
    Thanks in advance
    Manfred

    Reply

  • Boyan Boyan admin's avatar

    Posted on Jan 26, 2012 (permalink)

    Hi,

    This is the expected behavior of the control. The value is not updated when you are editing it as this will result in problems when you are entering Value and the data is changed in the meantime.

    If you wish to workaround this behavior you can remove the focus and then focus again the control and this will update the Value.

    All the best,
    Boyan
    the Telerik team

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

    Reply

  • Posted on Jan 26, 2012 (permalink)

    Hy Boyan,

    thank you for your response.
    Unfortunately it's not possible (without a very large amount of coding) to remove the focus.
    The reason - I have (next to other controls) a TextBlock bound to the value.
    This TextBlock can be dragged around which changes the value in the RadNumericUpDown.
    Since a TextBlock is not focusable the focus stays on the RadNumericUpDown.

    The same happens in another scenario where the value is bound to a property which changes "somehow in the background".

    Regards
    Manfred

    Reply

  • Konstantina Konstantina admin's avatar

    Posted on Jan 30, 2012 (permalink)

    Hello Manfred,

    I can suggest you the following approach, even though that changing the value while the NumericUpDown control is in edit mode is considered as inconsistent behaviour:
    - inherit the NumericUpDown control and override its OnValueChanged property. In it, after the base call, call the ChangeValue method with 0 as parameter:

    public class MyNumeric : RadNumericUpDown
        {
            protected override void OnValueChanged(RadRangeBaseValueChangedEventArgs e)
            {
                base.OnValueChanged(e);
                ChangeValue(0);
            }
        }

    However, we don't guarantee that the control will still have consistent behaviour, and some side effects and malfunction is highly possible.

    All the best,
    Konstantina
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > NumericUpDown > UI value not updated
Related resources for "UI value not updated"

WPF NumericUpDown Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]