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

RadComboBox all getting focus on page load

1 Answer 40 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 10 May 2012, 02:48 PM
Hi all,

I have a radgrid being loaded with a dataset at page load.  We have ~60 columns in the radgrid with a bunch of radcomboboxes in each row.  I need to have a OnClientFocus event on the radcomboboxes for something I am doing in jquery.  I noticed my page load was a bit slower after I added this, so I added a console.log to the onfocus function, and noticed that it is being called 50+ times (I believe it is the total amount of radcomboboxes I have on the page, or at least pretty close) as soon as the page loads.

Is each one of these radcomboboxes grabbing focus on page load for some reason?  Is this intended behavior?  Is there anything to get around this happening?

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 14 May 2012, 09:12 AM
Hi,

If the OnClientFocus event handler function is attached from the mark up to the RadComboBoxes defined in your columns than this event will be fired for every combobox in every row. You could try to add this event handler only for specific combo boxes, but this should be done from code behind. The ItemCreated event of the RadGrid should be handled and then a reference to a specific RadComboBox should be obtained. The event handler function should be attached in the following manner:
RadComboBox1.OnClientLoad = "onClientLoadHandler";

Regards,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ComboBox
Asked by
Michael
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or