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

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

3 Answers 88 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
Marcelo
Top achievements
Rank 1
Marcelo asked on 04 Jul 2011, 01:24 PM
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?

3 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 07 Jul 2011, 04:05 PM
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!

0
Marcelo
Top achievements
Rank 1
answered on 07 Jul 2011, 06:47 PM
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)
0
Valeri Hristov
Telerik team
answered on 15 Jul 2011, 10:03 AM
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!

Tags
NumericUpDown
Asked by
Marcelo
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Marcelo
Top achievements
Rank 1
Valeri Hristov
Telerik team
Share this question
or