5 Answers, 1 is accepted
0
Hello Kevin,
Unfortunately RadNumericUpDown does not provide a way to get/set the selection of its internal TextBox. You could try the following code:
var textBox = RadNumericUpDown1.ChildrenOfType<TextBox>().FirstOrDefault();
if (textBox != null)
{
// manupulate the selection here
}
but I strongly recommend using it only for testing purposes, since it might add performance penalty on your application.
I will add this request to the product backlog and we will consider it for its future development.
All the best,
Valeri Hristov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Unfortunately RadNumericUpDown does not provide a way to get/set the selection of its internal TextBox. You could try the following code:
var textBox = RadNumericUpDown1.ChildrenOfType<TextBox>().FirstOrDefault();
if (textBox != null)
{
// manupulate the selection here
}
but I strongly recommend using it only for testing purposes, since it might add performance penalty on your application.
I will add this request to the product backlog and we will consider it for its future development.
All the best,
Valeri Hristov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0

Kevin
Top achievements
Rank 1
answered on 07 Dec 2009, 10:26 PM
Hello,
I tried your sample code, but it always return the null. So I couldn't get the internal reference to TextBox.
Thanks!
-Kevin
I tried your sample code, but it always return the null. So I couldn't get the internal reference to TextBox.
Thanks!
-Kevin
0
Accepted
Hi Kevin,
I suppose that you are trying to call my code too early, e.g. in a Loaded event or the page constructor - at this time the template of RadNumericUpDown is not applied yet and the TextBox is not created, hence the method returns an empty array. You could try the following:
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
this.RadNumericUpDown1.ApplyTemplate();
var length = this.RadNumericUpDown1.ChildrenOfType<TextBox>()[0].SelectionLength;
}
}
Regards,
Valeri Hristov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I suppose that you are trying to call my code too early, e.g. in a Loaded event or the page constructor - at this time the template of RadNumericUpDown is not applied yet and the TextBox is not created, hence the method returns an empty array. You could try the following:
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
this.RadNumericUpDown1.ApplyTemplate();
var length = this.RadNumericUpDown1.ChildrenOfType<TextBox>()[0].SelectionLength;
}
}
Regards,
Valeri Hristov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0

Gabe
Top achievements
Rank 1
answered on 19 Apr 2011, 08:54 PM
IS there any update on this. I would like to have a better way to get the SelectedText for the NumericUpDown control.
0
Hello Gabe,
This functionality has not changed and I still cannot set a specific delivery date for this feature.
Kind regards,
Valeri Hristov
the Telerik team
This functionality has not changed and I still cannot set a specific delivery date for this feature.
Kind regards,
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