I have a combobox with RadTreeview inside it.
I have Ajaxified this tree view to update Panel on the page.
Once I click item from a treeview dropdown gets locked. If I click somwhere on the page than again I am able to select Item from a tree view.
This is the code for combobox and Ajaxification
Actual combobox Markup:
<telerik:RadComboBox ID="cboCategory" runat="server" Skin="Vista"
OnClientDropDownOpened="OnClientDropDownOpenedHandler" AutoPostBack="false"
meta:resourcekey="cboCategory" AppendDataBoundItems="true" Width="290px" MaxHeight="110px" >
<ItemTemplate>
<telerik:RadTreeView ID="tvCategory" runat="server" Skin="Vista"
OnClientNodeClicking="nodeClicking" onnodeclick="tvCategory_NodeClick" EnableEmbeddedScripts="true" AutoPostBack="false" >
</telerik:RadTreeView>
</ItemTemplate>
<Items>
<telerik:RadComboBoxItem Value="0"/>
</Items>
</telerik:RadComboBox>
Ajax Settings:
<telerik:AjaxSetting AjaxControlID="tvCategory">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="pnlDetail" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
function nodeClicking(sender, args) {
var comboBox = $telerik.findControl(document, "cboCategory");
var node = args.get_node()
comboBox.set_text(node.get_text());
comboBox.trackChanges();
//comboBox.get_items().getItem(0).set_value(node.get_text());
//comboBox.commitChanges();
var cboItem = comboBox.get_items().getItem(0);
cboItem.set_value(node.get_text());
comboBox.set_text(node.get_text());
comboBox.commitChanges();
comboBox.hideDropDown();
}
function StopPropagation(e) {
if (!e) {
e = window.event;
}
e.cancelBubble = true;
}
function OnClientDropDownOpenedHandler(sender, eventArgs) {
var treeName = "tvCategory";
var tree = sender.get_items().getItem(0).findControl(treeName)
var selectedNode = tree.get_selectedNode();
if (selectedNode) {
selectedNode.scrollIntoView();
}
}