I need to access a RadComboBox that is defined in one .ascx file from a different .ascx file so that I can get/set values in it. I've read this information https://docs.telerik.com/devtools/aspnet-ajax/general-information/get-client-side-reference#using-jquery-selectors but it isn't working. All help is greatly appreciated. Here are the details about what I have:
In View.ascx the control is specified:
<telerik:RadComboBox RenderMode="Lightweight" ID="cmbReportTool" filter="Contains" runat="server"
oWrap="false" class="cmb-report-tool" CheckBoxes="true" EnableCheckAllItemsCheckBox="true" width="400px">
</telerik:RadComboBox>
and the following JavaScript exists in a different .ascx file:
function () {
var combo = $telerik.$("[id$='cmbReportTool']").get(0).control;
}
I've played around with the JS and used an alert() to quickly see what I have. The following code presents "combo: [object HTMLDivElement]"
function () {
var combo = $telerik.$("[id$='cmbReportTool']").get(0);
alert('combo: ' + combo);
}
The following code presents "combo: undefined"
function () {
var combo = $telerik.$("[id$='cmbReportTool']").get(0).control;
alert('combo: ' + combo);
}
Here are some specifics about my environment:
OS: Windows 7 Enterprise with service pack 1
Browser: Internet Explorer 11
Telerik Web UI version 2016.3.1027.40