Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Tree Node Problem

Reply
Thread Tools

Tree Node Problem

 
 
JJ297
Guest
Posts: n/a
 
      08-17-2007
When I click on the Root it appears to double all of the nodes. Is
there something in properities to turn this off?

Thanks!

 
Reply With Quote
 
 
 
 
Masudur
Guest
Posts: n/a
 
      08-18-2007
On Aug 17, 10:09 pm, JJ297 <(E-Mail Removed)> wrote:
> When I click on the Root it appears to double all of the nodes. Is
> there something in properities to turn this off?
>
> Thanks!


Hi..

Are you filling the tree on tree note selecte event...?
please be a little more descriptive

Masudur

 
Reply With Quote
 
 
 
 
=?Utf-8?B?TmF0aGFuaWVsIEdyZWVuZQ==?=
Guest
Posts: n/a
 
      08-20-2007
Most likely you are populating your treenodes in Page_Load and you are not
checking whether the page is posting back.
Page_Load fires every time the page loads (even on postbacks).
The solution to this is - in Page_Load check to see if the page has posted
back and if it is posting back then don't populate the treelist (because it's
already been populated)

so (assuming you were using data binding)
Page_Load(....)
{
if (IsPostBack==false)
{
TreeView.DataBind();
// or
PopulateTreeView();
}
}

in vb.net it would be
if IsPostback=false then
....
end if

Hope this helps.

"JJ297" wrote:

> When I click on the Root it appears to double all of the nodes. Is
> there something in properities to turn this off?
>
> Thanks!
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
find path from one tree node to another tree node Peter Mueller Java 6 01-13-2008 02:36 AM
Null parent node on custom tree node after populate on demand John Bankhead ASP .Net Web Controls 0 12-04-2006 06:29 PM
xsl variable $node/text() but $node can non-node-set help! Tjerk Wolterink XML 2 08-24-2006 03:28 AM
How to set the node indent property between the parent node and the leaf node viveknatani@gmail.com ASP .Net 0 02-13-2006 07:11 PM
B tree, B+ tree and B* tree Stub C Programming 3 11-12-2003 01:51 PM



Advertisments