|
Rank: Member Groups: Member
Joined: 8/13/2008 Posts: 14
|
I have a dynamic treeview implemented and it works great. The only thing i want to change about it is that my menu should be expanded (all nodes), not collapsed. At this time al nodes of the menu are collapsed. Can anybody help me to make it all expand by default?
Thanks in advance, Anthony Van den bossche Junior Web Developer
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi, I believe you can call ExpandAll method on the server side to expand all nodes: http://www.essentialobjects.com/ViewDoc.aspx?t=EO.Web.TreeView.ExpandAll.htmlThanks!
|
|
Rank: Member Groups: Member
Joined: 8/13/2008 Posts: 14
|
I used this code and it only works for one of my rootnodes. Do you see any other way? Thank you very much, Anthony.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi,
We are not aware of any problem with ExpandAll. You may want to check when ExpandAll is called. The function will not expand all nodes that are added after it is called.
The ultimate way is to set each node's Expanded property to true. This is actually what ExpandAll does ---- it recursively walk through the whole TreeView and set each Node's Expanded to true.
Thanks
|
|
Rank: Member Groups: Member
Joined: 8/13/2008 Posts: 14
|
Hi,
in my PageLoad event i have the following:
// Populate from the data source (mainTable); Menu1.DataBind(); Menu1.ExpandAll();
So after the Databind() function i tell the object to ExpandAll().
This doesn't do the trick. I have also tried, in the .aspx page, to set all nodes hardcoded to ExpandAll
Note: i made the treeview dynamic, maybe this has got something to do with this problem.
Thank you already for your quick replies! If only every Forum gives such good answers on short notice...
Greetings, Anthony.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
dios wrote:I have also tried, in the .aspx page, to set all nodes hardcoded to ExpandAll We tried the following steps and it works fine: 1. Create a blank Web Form; 2. Place a TreeView inside the Form. Right click the TreeView to bring up the TreeView Builder and initializes it with any built-in template rather than the free one (the free ones has no items); 3. Inside the page's Page_Load event, call TreeView1.ExpandAll(); Run the page and you would see all the nodes are expanded. You can try the same and see if it works for you. If the problem continues, we would need you to create a test page to demonstrate the problem. We will need to run the page, so try to change the code so that it does not rely on your database (for example, you create create the DataTable object by code) or any other of your code. We will look into it as soon as we have that. Thanks!
|
|
Rank: Member Groups: Member
Joined: 8/13/2008 Posts: 14
|
Hi, the problem seems to be persistent. I can place the project online and give you acces via FTP through a login and password. Would this be Ok for you? If it's ok i can PM you the credentials or email them. I do have an idea what the problem might be, but it is just a guess.. Whenever i add a rootnode, that node stays open. all the other (root)nodes before the newly created one close up. Is it because i can have only 1 rootnode? Below is printscreen of my database driven treeview. Greetings, Anthony.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi,
Yes. Placing the project online should be a good way for us to see what's going on. We are not aware of any problems as regard to one root node. So we will have to look into it and see.
Thanks
|
|
Rank: Member Groups: Member
Joined: 8/13/2008 Posts: 14
|
Hello, i have emailed you the FTP credentials and the online location of the website. In case you did not receive anything, you can mail me directly via anthony@dcinet.beThanks for your time, Anthony.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi,
Yes. We have received that and will be looking into it as soon as possible.
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi,
We looked into your code. You need to clear SingleExpandMode for the TreeView. With that property set, the TreeView will only expand one node at any given time.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 8/13/2008 Posts: 14
|
Hello, my treeview works perfectly. From now on i am only using eo objects . BTW i love the HTML editor, finally an alternative for the FreeTextBox.dll shait. Great support! Greets, Anthony.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Excellent. Glad to hear you love our product!
|
|