Tree Node Problem

J

JJ297

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

Thanks!
 
M

Masudur

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
 
G

Guest

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top