Treeview won't collapse/expand dynamically

Discussion in 'ASP .Net' started by pej.odonnell@gmail.com, Jul 16, 2007.

  1. Guest

    Hello everyone,

    2 Issues: 1. When treeview renders all parent nodes are open? I want
    it to render closed? 2. When I try to collapse programmatically, it
    does not do anything?

    I'm using a tree view with a sitemap to create a menu. The treeview
    is contained in a master page.

    <asp:TreeView ID="TreeView1" runat="server"
    DataSourceID="SiteMapDataSource1" ImageSet="Simple" Width="249px">
    <ParentNodeStyle Font-Bold="False" />
    <HoverNodeStyle Font-Underline="True"
    ForeColor="#5555DD" />
    <SelectedNodeStyle Font-Underline="True"
    ForeColor="#5555DD" HorizontalPadding="0px"
    VerticalPadding="0px" />
    <NodeStyle Font-Names="Tahoma" Font-
    Size="10pt" ForeColor="Black" HorizontalPadding="0px"
    NodeSpacing="0px" VerticalPadding="0px" /
    >

    </asp:TreeView>

    Here's the code I tried in the Page Load event of the Master page:

    TreeView1.CollapseAll();

    I would appreciate any suggestions. Thanks.
     
    , Jul 16, 2007
    #1
    1. Advertising

  2. T. Church Guest

    Hi,

    I ended up putting the CollapseAll control into the treeview's
    DataBound event instead of page load - that way you collapse it after
    it's done loading the data.

    HTH
     
    T. Church, Jul 16, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gönen EREN
    Replies:
    4
    Views:
    4,104
    Gönen EREN
    Aug 16, 2003
  2. Edwin Knoppert
    Replies:
    1
    Views:
    5,218
    Edwin Knoppert
    Nov 9, 2005
  3. vivek
    Replies:
    2
    Views:
    6,278
    pushp
    Jun 14, 2007
  4. jim
    Replies:
    0
    Views:
    581
  5. M.L.
    Replies:
    9
    Views:
    314
Loading...

Share This Page