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

How select text/value in SpinEditor?

5 Answers 391 Views
SpinEditor
This is a migrated thread and some comments may be shown as answers.
Stim24
Top achievements
Rank 1
Stim24 asked on 20 Nov 2018, 02:02 AM

How select text/value in SpinEditor?

If set focus is object (method Enter) value SpinEditor select all

How to do it?

5 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 20 Nov 2018, 11:13 AM
Hello, Tim, 

By default, when you focus the RadSpinEditor, its text is selected. RadSpinEditor hosts the standard MS TextBox which exposes the SelectAll method. However, in order to select the text programmatically, make sure that the SpinElement.TextBoxItem.HideSelection property is set to false:

private void radButton1_Click(object sender, EventArgs e)
{
    this.radSpinEditor1.SpinElement.TextBoxItem.HideSelection = false;
    this.radSpinEditor1.SpinElement.TextBoxItem.SelectAll();
}

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Stim24
Top achievements
Rank 1
answered on 21 Nov 2018, 01:29 AM

Hello Dess,

This is not work.

I used event("Enter") on RadSpinEditor. Text on RadSpinEditor is not select.

private void radSpinEditor1_Enter(object sender, EventArgs e)
{
    this.radSpinEditor1.SpinElement.TextBoxItem.HideSelection = false;
    this.radSpinEditor1.SpinElement.TextBoxItem.SelectAll();
}
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 22 Nov 2018, 10:55 AM
Hello, Tim, 

Following the provided information, I was unable to reproduce the issue you are facing. The text is selected on my end. Please refer to the attached gif file illustrating the behavior I obtained with the specified version. I have attached my sample project. Feel free to modify it in a way to reproduce the experienced issue and get back to me with it so I can investigate the precise case. Thank you in advance. 
 
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Stim24
Top achievements
Rank 1
answered on 28 Nov 2018, 02:47 AM

Dess your program code working not correctly.

On first click(focus) radSpinEditor1 work correctly. But if next click other control on form and then click on radSpinEditor1 text is not select

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 28 Nov 2018, 09:51 AM
Hello, Tim,  

You can handle the MouseUp event of the hosted TextBox in RadSpinEditor and force the selection. Thus, you will cover the case when you click other controls and then back click the RadSpinEditor:

this.radSpinEditor1.SpinElement.TextBoxItem.TextBoxControl.MouseUp += radSpinEditor1_MouseUp;
 
private void radSpinEditor1_MouseUp(object sender, MouseEventArgs e)
{
    this.radSpinEditor1.SpinElement.TextBoxItem.HideSelection = false;
    this.radSpinEditor1.SpinElement.TextBoxItem.SelectAll();
}

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
SpinEditor
Asked by
Stim24
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Stim24
Top achievements
Rank 1
Share this question
or