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

Focus textbox in custom cell gridview

2 Answers 86 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bao
Top achievements
Rank 1
Bao asked on 14 Jul 2017, 04:47 AM

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 Answers, 1 is accepted

Sort by
0
Bao
Top achievements
Rank 1
answered on 14 Jul 2017, 05:00 AM
And how can i align the radio button center ? I tried text alignment but it is not working.
0
Dimitar
Telerik team
answered on 17 Jul 2017, 10:19 AM
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.
Tags
GridView
Asked by
Bao
Top achievements
Rank 1
Answers by
Bao
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or