Step-1: Add a TextBox to your Page.
<asp:TextBox ID="Module" runat="server"></asp:TextBox>
Step-2: Add a Panel and place a treeview inside it.
<asp:Panel ID="pnl" runat="server">
<asp:TreeView
ID="ModuleTreeView"
runat="server"
ShowLines="true"
PopulateNodesFromClient="false"
BackColor="#99CCFF"
style="width:100%" ShowExpandCollapse="false">
</asp:TreeView>
</asp:Panel>
Step-3: Add a Ajax DropdownExtender and set its TargetControlID to the TextBox.
<asp:DropDownExtender ID="DropDownExtender1" runat="server"
TargetControlID="Module"
DropDownControlID="pnl">
</asp:DropDownExtender>
Step-4: Then write your own method to bind the treeview.
(I have described about binding a treeview in another blog- http://mydotnetcollections.blogspot.in/2012/07/how-to-bind-treeview-in-aspnet.html)
The final output is:
WHY WHEN I SELECT NODE IN TREEVIEW , VALUES NOT DISPLAY IN TEXTBOX ?
ReplyDeleteUse the ModuleTreeView event.
ReplyDeleteprotected void ModuleTreeView_SelectedNodeChanged(object sender, EventArgs e)
{
Module.Text = ModuleTreeView.SelectedNode.Text.ToString();
}
Integrate TreeView control within dropdownlist in C#.NET
ReplyDeletewhen page load TreeView in panel visabel open and closing (flickering).
ReplyDeleteRespect and that i have a neat supply: Whole House Renovation Cost house renovation experts
ReplyDelete