I add nodes dynamically to a treeview inside radcomboBox.
if (CountryComboBox.Items.Count == 0)
{
CountryComboBox.Items.Add(new RadComboBoxItem());
}
RadTreeView CountryTree = (RadTreeView)CountryComboBox.Items[0].FindControl("CountrySelector");
CountryTree.Nodes.Clear();
// communicate the tree's clientside via the attributes collection
CountryComboBox.Items[0].Attributes["TreeID"] = CountryTree.ClientID;
CountryTree.DataTextField = "Title";
CountryTree.DataFieldID = "ID";
CountryTree.DataValueField = "ID";
CountryTree.DataSource = Countries;
CountryTree.DataBind();
I tried
<telerik:RadAjaxManager runat="server" ID="MyAjaxManager" EnableAJAX="true" DefaultLoadingPanelID="LoadingPanel1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="CountryComboBox">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="CourseFinderSearchResults" />
<telerik:AjaxUpdatedControl ControlID="BrandSelector" />
<telerik:AjaxUpdatedControl ControlID="PriceSliderPanel" />
</UpdatedControls>
</telerik:AjaxSetting>
OR
<telerik:RadAjaxManager runat="server" ID="MyAjaxManager" EnableAJAX="true" DefaultLoadingPanelID="LoadingPanel1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="CountrySelector">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="CourseFinderSearchResults" />
<telerik:AjaxUpdatedControl ControlID="BrandSelector" />
<telerik:AjaxUpdatedControl ControlID="PriceSliderPanel" />
</UpdatedControls>
</telerik:AjaxSetting>
OR
if (CountryComboBox.Items.Count == 0)
{
CountryComboBox.Items.Add(new RadComboBoxItem());
}
RadTreeView CountryTree = (RadTreeView)CountryComboBox.Items[0].FindControl("CountrySelector");
CountryTree.Nodes.Clear();
// communicate the tree's clientside via the attributes collection
CountryComboBox.Items[0].Attributes["TreeID"] = CountryTree.ClientID;
CountryTree.DataTextField = "Title";
CountryTree.DataFieldID = "ID";
CountryTree.DataValueField = "ID";
CountryTree.DataSource = Countries;
CountryTree.DataBind();
MyAjaxManager.AjaxSettings.AddAjaxSetting(CountryTree, CourseFinderSearchResults);
MyAjaxManager.AjaxSettings.AddAjaxSetting(CountryTree, BrandSelector);
None of them works.
My client side code is like that
<telerik:RadComboBox
Width="200"
DropDownWidth="200"
Height="100"
ID="CountryComboBox"
Skin="Telerik"
Runat="server"
EmptyMessage="All Countries"
OnClientDropDownOpened="OnCountryComboClientDropDownOpenedHandler"
AllowCustomText="true">
<ItemTemplate>
<div id="div2">
<telerik:RadTreeView ID="CountrySelector"
runat="server"
Height="100"
Width="200"
OnNodeCheck="CountrySelected"
ShowLineImages="false"
OnClientNodeChecked="onCountryNodeChecked"
OnClientNodeClicking="CountryNodeClicking" CheckBoxes="true">
</telerik:RadTreeView>
</div>
</ItemTemplate>
</telerik:RadComboBox>
Appreciate your help,
Toby