I have an asp.net page with a TreeView and a DropDownList. The TreeView is defined in the codebehind :
<asp:TreeView ID="TreeViewResume" runat="server" ImageSet="Simple" NodeIndent="15" OnSelectedNodeChanged="ClickTreeViewResume">
<HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
<NodeStyle Font-Names="Tahoma" Font-Size="12pt" ForeColor="#203239" HorizontalPadding="0px"
NodeSpacing="0px" VerticalPadding="4px"></NodeStyle>
<ParentNodeStyle Font-Bold="False" />
<SelectedNodeStyle BackColor="#B5B5B5" Font-Underline="False" HorizontalPadding="2px"
VerticalPadding="0px" />
</asp:TreeView>
and so the DropDownList :
<asp:Panel ID="PanelDdl" runat="server">Sélection de la période : <asp:DropDownList ID="Ddl" runat="server" OnSelectedIndexChanged="Ddl_SelectedIndexChanged" AutoPostBack="true">
I load the TreeView by code in the Page_Load() :
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
RemplirTableau();
}
}
I would like that on the SelectedIndexChange() of the DropDownList the SQL source of the TreeView changes and the Treeview redraws.
protected void Ddl_SelectedIndexChanged(object sender, EventArgs e)
{
TreeViewResume.Nodes.Clear();
RemplirTableau();
}
Instead of this, only the first level nodes (parent nodes) of the TreeView are printed.
Any help please ?