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

cannot find control in usercontrol

1 Answer 80 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bevis
Top achievements
Rank 1
Bevis asked on 09 Feb 2012, 06:07 PM
Hi,

I have an usercontrol as an editformcontrol in a radgrid.  It has some comboboxes, textboxes etc.  Now I have problem to find the controls to set and get values.  When I debug, somehow I saw the ClientID as below which the clt05/clt09 changes for different rows.

RadPanelBar1_i1_grdRevenue_ctl00_ctl05_EditFormControl_drp_chg_cd
RadPanelBar1_i1_grdRevenue_ctl00_ctl09_EditFormControl_drp_chg_cd

How can I find the controls in javascript using code like $find('<%= drp_chg_cd.ClientID %>')

Thanks,

1 Answer, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 13 Feb 2012, 03:47 PM
Bevis:

Since your comboboxes and textboxes are embedded in the RadGrid EditForm Control, you'll need to use the findControl method to get a handle on them. Also, see this page for some insights:

Finding combobox on the client-side when it is embedded in another control

Hope this helps!
Tags
General Discussions
Asked by
Bevis
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Share this question
or