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

Enable disabled ComboBox on client side

5 Answers 129 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Alon
Top achievements
Rank 1
Alon asked on 25 Sep 2011, 01:53 PM
Hello,

I would like to get some help on how should I enable a combobox which has initial property Enable="false" in markup.

combo.enable(); throw an exception: Object doesn't support this property or method.

Thanks,

Alon

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 26 Sep 2011, 08:18 AM
Hello Alon,

Try the following code snippet to achieve your scenario.
function Open()
 {
       var comboBox = $find('<%=RadComboBox2.ClientID %>');
       comboBox.enable();
   }

Thanks,
Princy.
0
Alon
Top achievements
Rank 1
answered on 26 Sep 2011, 08:32 AM
Thanks Princy, but..

I allready tried that. My RadComboBox is under FormView which is under RadGrid and under View, so your exactly code can't find this object.

I use

var

 

rcbGender1 = document.getElementById(rbl.id.replace('rblIdType', 'rcbGender_Input'));
to find it (and it does). After that I use
rcbGender1.enable();

Any other ideas?

Thanks,
Alon.

 

0
Princy
Top achievements
Rank 2
answered on 26 Sep 2011, 08:49 AM
Hello Alon,
Telerik RadComboBox provides a client-side object of type RadComboBox . You can get a reference to the RadComboBox using
 $find("<%=name.ClientID%>");
Thanks,
Princy.
0
Ivana
Telerik team
answered on 27 Sep 2011, 03:42 PM
Hello Princy,

The following help article explains how the RadComboBox could be found when it is embedded in another control: RadComboBox: Finding combobox on the client-side when it is embedded in another control.

Hope this helps.

Greetings,
Ivana
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
0
Alon
Top achievements
Rank 1
answered on 09 Oct 2011, 12:36 PM
Hi,

Thanks all.
It was my mistake setting wrong clientId to $find() function.

My new code is:

var

 

rcbGenderid = rbl.id.replace('$', '_'); // rbl is the argument activating this function. rbl has '$' and rcb has '_' in the clientId.

 

 

var rcbGenderid = rcbGenderid.replace('rblIdType', 'rcbGender');

 

 

var rcbGender = $find(rcbGenderid);
rcbGender.enable();

With thanks,
Alon Mashiach

 

Tags
ComboBox
Asked by
Alon
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Alon
Top achievements
Rank 1
Ivana
Telerik team
Share this question
or