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

[Solved] NumericUpDown Event Example

2 Answers 191 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jon
Top achievements
Rank 1
Jon asked on 10 May 2012, 12:08 AM
Hello,

I have an App that uses the NumericUpDown to update a TextBlock. I'm having trouble writing the ValueChanging Event Handler. Does anyone have an example of a Value Changing Event Handler I can use?

Thanks,
JT

2 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 10 May 2012, 07:14 AM
Hello Jon,

Thanks for writing.

Subscribing for the ValueChanging event handler is as simple as the following:

    this.radNumericUpDown.ValueChanging += this.radNumericUpDown_ValueChanging;
 
void radNumericUpDown_ValueChanging(object sender, Windows.Controls.ValueChangingEventArgs<double> e)
{
 
}

The radNumericUpDown_ValueChanging method is the so-called event handler that will be called in case the ValueChanging event occurs. It is up to you and to the specifics of your app what code you will execute in this method.

I hope this helps.

Kind regards,
Deyan
the Telerik team

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

0
Vijay
Top achievements
Rank 1
answered on 10 Jun 2012, 10:09 AM
Hello Jon,

Please find the below source code. Hope this should be useful.

private void radNum_ValueChanging(object sender, Windows.Controls.ValueChangingEventArgs<double> e)
{
  if (numericUpDown1.Value + numericUpDown2.Value + numericUpDown3.Value > 3)
        {
            e.Cancel = true;
            RadWindow.Alert("No more than 3 in total");
        }
 
}


Thanks and Regards,
Vijay
MVC Corp.

Tags
NumericUpDown
Asked by
Jon
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Vijay
Top achievements
Rank 1
Share this question
or