RadNumericUpDown doesn't fire event MouseLeftButtonUp -> Notify Value after user stops to click

4 posts, 0 answers
  1. Marcelo
    Marcelo avatar
    28 posts
    Member since:
    Jul 2010

    Posted 04 Jul 2011 Link to this post

    Hi guys,

    I'm developing a control that has a lot of numeric and text "inputs" to update other controls.

    I need to update just when the value changes "completely", because my other controls will call the service if the event of update be fired.

    So, what I want is just fire the notify of value when user stops to click on the control.

    I did something like this on RadSlider using IsDeferredDraggingEnabled='True'

    public class PWSlider : RadSlider
      {
          public double PWValue
          {
              get { return (double)GetValue(PWValueProperty); }
              set { SetValue(PWValueProperty, value); }
          }
     
          // Using a DependencyProperty as the backing store for PWValue.  This enables animation, styling, binding, etc...
          public static readonly DependencyProperty PWValueProperty =
              DependencyProperty.Register("PWValue", typeof(double), typeof(PWSlider), new PropertyMetadata(OnPWValuerPropertyChanged));
     
          private static void OnPWValuerPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
          {
              if ((o as PWSlider).Value != (double)e.NewValue)
                  (o as PWSlider).Value = (double)e.NewValue;
          }
     
          public PWSlider()
          {
              this.ValueChanged += new RoutedPropertyChangedEventHandler<double>(PWSlider_ValueChanged);
          }
     
          void PWSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
          {
              PWValue = e.NewValue;
          }
      }



    Any thoughts to how implement this on RadNumericUpDown?
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 07 Jul 2011 Link to this post

    Hello Marcelo,

    I suggest you to use the UpdateValueEvent property of the NumericUpDown control and set it to LostFocus.

    Hope this helps.

    Regards,
    Konstantina
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft banner
  4. Marcelo
    Marcelo avatar
    28 posts
    Member since:
    Jul 2010

    Posted 07 Jul 2011 Link to this post

    Hi Konstantina,

    Sorry, but didn't work as expected.

    UpdateValueEvent="PropertyChanged"
    and
    UpdateValueEvent="LostFocus"

    work on the same way on this example:

    <telerik:RadNumericUpDown x:Name="numeric" UpdateValueEvent="LostFocus" Value="10" Maximum="120000" Minimum="0"/>
          <TextBox Text="{Binding ElementName=numeric, Path=Value}" Grid.Column="1"></TextBox>

    Just to clarify, what I want is update the value on the binding just when the user stop to click, as this example above.

    (just to know, my RadControls version: 2011.1.419.1040)
  5. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 15 Jul 2011 Link to this post

    Hi Marcelo,

    Unfortunately the behavior that you need is not available in RadNumericUpDown. I apologize for the inconvenience.

    Greetings,
    Valeri Hristov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top