CSS Friendly TreeView

Last post 07-01-2009 8:29 AM by mroonal. 5 replies.

Sort Posts:

  • CSS Friendly TreeView

    05-12-2006, 9:15 AM
    • Member
      60 point Member
    • HardMike
    • Member since 09-30-2005, 10:03 AM
    • Posts 13

    I downloaded and added support for css friendly controls. Everything works except for a issue with the treeView. When I click a linked node and post to the page the treeView collapses instead of selecting the node. When I exclude the CSSFriendly.browsers from my project it works again. Any suggestions on this cause I really need this functionality.

    Thanx Mike,

  • Re: CSS Friendly TreeView

    05-12-2006, 12:56 PM
    • Contributor
      3,298 point Contributor
    • Russ Helfand
    • Member since 09-14-2005, 6:22 PM
    • Groovybits.com
    • Posts 741

    Hi Mike, can you help me better understand the issue here?  If you are observing that the adapted TreeView doesn't retain a memory of its state-of-expansion after posting back... then this is a known limitation of the current TreeView adapter.  It's already something that I've got on the to-do list for a future rev of this sample kit.  Basically, it involves sending a bit more info (concerning what is expanded) back to the server during these postbacks so the server can restore the expansion state when the page is sent back down.

    There is some intersection between this feature and another to-do item: populating the TreeView nodes upon demand, rather than always having all the nodes defined all the time. Hopefully, we can nail both of these enhancements to the adapted TreeView code in a not-too-distant rev of the adapter kit.

    Meanwhile, maybe someone in the community of forum readers would like to suggest some code we could stick in the current CSSFriendly.MenuAdapter with some cut-n-paste magic.

    Russ Helfand
    Groovybits.com
  • Re: CSS Friendly TreeView

    05-15-2006, 5:06 AM
    • Member
      60 point Member
    • HardMike
    • Member since 09-30-2005, 10:03 AM
    • Posts 13

    Hi Russ!

    I´m aware of that the treeView doesn´t remember it´s state of expansion and I know of the workarounds. To be honest I´m not sure why this works for me(I don´t fix what isn´t broken) but the code below does the trick with no code beside.

    <asp:TreeView ID="articleTreeView" runat="server" 
       DataSourceID="SiteMapDataSourceArticleTree"
       SkinID="tree"
       EnableClientScript="true"
       EnableViewState="true" >
       <DataBindings>
          <asp:TreeNodeBinding
             DataMember="SiteMapNode" 
             NavigateUrlField="Url" 
             SelectAction="Expand" 
             TextField="Title" />
        </DataBindings>
    </asp:TreeView>

    Without CssFriendlyAdapters this selects the node and expands the tree after postback. With CssFriendlyAdapters the tree closes and the current node isn´t styled as selected. The SiteMapPath connected to the same provider however shows the correct path. Any suggestions because I need the css functionality to style my tree.

    Thanx! /Mike

  • Re: CSS Friendly TreeView

    10-26-2006, 12:02 PM
    • Contributor
      3,298 point Contributor
    • Russ Helfand
    • Member since 09-14-2005, 6:22 PM
    • Groovybits.com
    • Posts 741
    Beta 3 of the kit, posted to http://www.asp.net/cssadapters earlier this week, supports automatic reexpansion of the adapted TreeView.
    Russ Helfand
    Groovybits.com
  • Re: CSS Friendly TreeView

    01-21-2008, 1:11 AM
    • Member
      4 point Member
    • fandibong
    • Member since 10-24-2007, 2:05 AM
    • Posts 3

    Hi,

    How can I put CSS Friendy Tree View Expansion State into memory?

    For example, say I have a Tree View and when you click on the node it will navigate to other page (not just post back to same page) and on that next page I want to display the selected Tree Node.

    The only way I think it could be done is if I attach to TreeNodeCollpased and TreeNodeExpanded event and put the expansion state in Session then display it on the other page. The problem is I cant attach to these 2 events (could be because I use CSS Friendly Adapters).

    Please help.....

    Thanks

  • Re: CSS Friendly TreeView

    07-01-2009, 8:29 AM
    • Participant
      1,000 point Participant
    • mroonal
    • Member since 06-22-2009, 2:00 AM
    • India
    • Posts 207

    Hi,

    Can we apply css to Treeview... node level wise...?

    Means,

    One css to Parent Nodes,

    One css to second level nodes. (Same css shd b applied even if it is leaf node)

    ??

    Regards, Mroonal
Page 1 of 1 (6 items)