I want to populate the tree view on initial page load.
I am unable to find the tree view inside combo.
I call this code on page load:
private
void LoadRootNodes(string currentUserContext)
{
DataTable data = new DataTable();
data =
BO.GetOwners(currentUserContext,);
RadTreeView tvOwner = (RadTreeView)RadComboBox1.FindControl("tvOwner");
tvOwner.DataTextField = "Name";
tvOwner.DataFieldID = "EmpId";
tvOwner.DataFieldParentID = "ParentId";
tvOwner.DataSource = data;
tvOwner.DataBind();
}
and below is my combo declaration:
<
telerik:RadComboBox ID="RadComboBox1" runat="server" Height="140px" Width="215px" ShowToggleImage="True" Skin="WebBlue" Style="vertical-align: middle;">
<ItemTemplate>
<div id="div1">
<telerik:RadTreeView runat="server" ID="tvOwner" OnNodeExpand="tvOwner_NodeExpand" Skin="WebBlue">
</telerik:RadTreeView>
</div>
</ItemTemplate>
<Items>
<telerik:RadComboBoxItem Text="" />
</Items>
</telerik:RadComboBox>
when i do RadComboBox1.FindControl("tvOwner") my treeview comes as null.
Please suggest.