Focus textbox in custom cell gridview

3 posts, 0 answers
  1. Bao
    Bao avatar
    54 posts
    Member since:
    Jan 2015

    Posted 13 Jul 2017 Link to this post

    Hi,

    I am following this example : http://www.telerik.com/support/kb/winforms/details/creating-a-radradiobuttoncellelement

    It is working now, but i want to add 1 textbox behind the last radio button. Default this textbox is disable. When click last radio button, it will be enabled and focus.

    I already added it. But i can not set focus when i click on the radio button.

    Now i am putting the code in SetContentCore:

     customText.Enabled = true;
     customText.Focus();

    But it is not working, because when i click to any radio button, it will run SetContentCore method all rows.

    Thanks. 

  2. Bao
    Bao avatar
    54 posts
    Member since:
    Jan 2015

    Posted 14 Jul 2017 Link to this post

    And how can i align the radio button center ? I tried text alignment but it is not working.
  3. Dimitar
    Admin
    Dimitar avatar
    2831 posts

    Posted 17 Jul 2017 Link to this post

    Hi Bao,

    It will better to use a RadTextBoxControlElement for this case. Make sure the following properties are set when adding to the cell:
    textbox = new RadTextBoxControlElement();
    textbox.ShouldHandleMouseInput = true;
    textbox.NotifyParentOnMouseInput = false;
    textbox.MinSize = new Size(50, 22);
    this.Children.Add(textbox);

    Then you can set the focus in the Click or MouseDown events of the radio button. In addition, I am not sure how you want to center the button. Could you send us your current implementation so we ca test this locally. In general, the arrangement is done in the ArrangeOverride method.

    I hope this will be useful. I am looking forward to your reply.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top