How select text/value in SpinEditor?

6 posts, 0 answers
  1. Stim24
    Stim24 avatar
    6 posts
    Member since:
    Apr 2013

    Posted 19 Nov 2018 Link to this post

    How select text/value in SpinEditor?

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

    How to do it?

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3369 posts

    Posted 20 Nov 2018 Link to this post

    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.
  3. Stim24
    Stim24 avatar
    6 posts
    Member since:
    Apr 2013

    Posted 20 Nov 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    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();
    }
  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3369 posts

    Posted 22 Nov 2018 Link to this post

    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.
  5. Stim24
    Stim24 avatar
    6 posts
    Member since:
    Apr 2013

    Posted 27 Nov 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    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

  6. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3369 posts

    Posted 28 Nov 2018 Link to this post

    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.
Back to Top