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

Proper way to attach client-side onfocus event to GridDropDownColumn

1 Answer 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Travis
Top achievements
Rank 1
Iron
Travis asked on 10 May 2016, 09:57 PM

I have a question regarding the proper way to attach an onfocus client-side event so it will generate on the input tag rather than the parent div tag (because it doesn't fire on the div tag) for a GridDropDownColumn?

I am currently attempting this in the PreRender event for the grid since I am placing every item in the grid into edit mode. But, I can't figure out how to get the onfocus to generate on the input tag containing the text for the GridDropDownColumn. Any help would be greatly appreciated.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 13 May 2016, 07:41 AM
Hi Travis,

You can access the generated RadComboBox or RadDropDownList in edit mode using the approach demonstrated in the following section:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-editinsert-mode

Then, you can attach the RadComboBox1.OnClientFocus = "focusHandlerName"; event handler and inside the javascript function focusHandlerName(sender, args){ ... } access the required element using the sender and args objects.

I hope this will prove helpful.

Regards,
Eyup
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Travis
Top achievements
Rank 1
Iron
Answers by
Eyup
Telerik team
Share this question
or