Tree View for Non-Navigational Purposes

Discussion in 'ASP .Net' started by =?Utf-8?B?ZGF2ZS5kb2xhbg==?=, Mar 19, 2006.

  1. I have generated a nice tree view that displays some otherwise cyptic XML in
    an easy to follow manner. The trouble is that the TreeView assumes that I'm
    wanting a link in each of the nodes, and I really just want to display them
    for view only. How can I disable the link-ness of the data in the tree view?
    I have tried setting the target of the links to "javascript:false;" but it
    still causes a postback and flashes the page to the top destroying my scroll
    position.

    Am I missing something?
     
    =?Utf-8?B?ZGF2ZS5kb2xhbg==?=, Mar 19, 2006
    #1
    1. Advertising

  2. Set the NavigateUrl property of the TreeNode to an empty string:

    "The text of a node in the TreeView control can be in one of two modes:
    selection mode or navigation mode. By default, a node is in selection mode.
    To put a node into navigation mode, set the node's NavigateUrl property to a
    value other than an empty string (""). To put a node into selection mode, set
    the node's NavigateUrl property to an empty string.
    http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.treenode(VS.80).aspx

    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "dave.dolan" wrote:

    > I have generated a nice tree view that displays some otherwise cyptic XML in
    > an easy to follow manner. The trouble is that the TreeView assumes that I'm
    > wanting a link in each of the nodes, and I really just want to display them
    > for view only. How can I disable the link-ness of the data in the tree view?
    > I have tried setting the target of the links to "javascript:false;" but it
    > still causes a postback and flashes the page to the top destroying my scroll
    > position.
    >
    > Am I missing something?
     
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=, Mar 20, 2006
    #2
    1. Advertising

  3. haha, thanks. I always go making things difficult. (I had started to look for
    more elaborate things like overriding the render method) figures it something
    simple.

    "Phillip Williams" wrote:

    > Set the NavigateUrl property of the TreeNode to an empty string:
    >
    > "The text of a node in the TreeView control can be in one of two modes:
    > selection mode or navigation mode. By default, a node is in selection mode.
    > To put a node into navigation mode, set the node's NavigateUrl property to a
    > value other than an empty string (""). To put a node into selection mode, set
    > the node's NavigateUrl property to an empty string."
    > http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.treenode(VS.80).aspx
    >
    > --
    > HTH,
    > Phillip Williams
    > http://www.societopia.net
    > http://www.webswapp.com
    >
    >
    > "dave.dolan" wrote:
    >
    > > I have generated a nice tree view that displays some otherwise cyptic XML in
    > > an easy to follow manner. The trouble is that the TreeView assumes that I'm
    > > wanting a link in each of the nodes, and I really just want to display them
    > > for view only. How can I disable the link-ness of the data in the tree view?
    > > I have tried setting the target of the links to "javascript:false;" but it
    > > still causes a postback and flashes the page to the top destroying my scroll
    > > position.
    > >
    > > Am I missing something?
     
    =?Utf-8?B?ZGF2ZS5kb2xhbg==?=, Mar 20, 2006
    #3
    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. Stub

    B tree, B+ tree and B* tree

    Stub, Nov 12, 2003, in forum: C Programming
    Replies:
    3
    Views:
    10,234
  2. Adrienne Boswell

    Opinions on placement of navigational items

    Adrienne Boswell, Jul 25, 2006, in forum: HTML
    Replies:
    6
    Views:
    350
    Adrienne Boswell
    Jul 26, 2006
  3. raki
    Replies:
    1
    Views:
    1,195
    Alexey Smirnov
    Jun 24, 2009
  4. Ahmad
    Replies:
    0
    Views:
    127
    Ahmad
    Nov 16, 2003
  5. shree
    Replies:
    2
    Views:
    178
Loading...

Share This Page