We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

newbie: TreeViewAdv fill on demand

Thread ID:





8228 Oct 28,2003 06:31 PM UTC Oct 29,2003 03:59 PM UTC WinForms 4
Tags: Tools
Daniele Fusi
Asked On October 28, 2003 06:31 PM UTC

I'm having a problem with the TreeViewAdv control (Essential Suite, but I suppose it's just my fault: in my application, a treeview should allow the child nodes to be filled on demand when the user clicks the [+] to expand the node. Here's a sample dummy code: I create a windows forms project and: 1) I insert a treeview (named _tree) into a form and set its LoadOnDemand=True, FullRowSelect=True; all the other properties are left unchanged to their defaults. 2) I add a handler for BeforeExpand and implement it as follows: if ((e.Node.ExpandedOnce) || (e.Node.Parent != _tree.Root)) return; for (int i=1; i<=3; i++) e.Node.Nodes.Add(new TreeNodeAdv(i.ToString())); (=just add 3 children to the expanding node). 3) I add a button which when clicked does the following: _tree.Nodes.Clear(); for (int i=0; i<10; i++) _tree.Nodes.Add(new TreeNodeAdv(new string((char)(i+65),1))); (=clear the tree and then add 10 nodes to the root node, with the text "A", "B"... and so on). Now, when I click the 1st time the button, the tree is filled; then I expand any node, and the BeforeExpand handler is called and appends 3 children as expected. BUT when I click it again, the tree is cleared and nothing is shown; if I click it again, I get this exception: "An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll Additional information: '0' is not a valid value for 'value'. 'value' should be between 'minimum' and 'maximum'." at the line: _tree.Nodes.Add(new TreeNodeAdv(new string((char)(i+65),1))); What I'm doing wrong in clearing and then refilling the tree? How the fill-on-demand feature is supposed to be correctly used? Thanks guys...

Arun Srinivasan [Syncfusion]
Replied On October 28, 2003 08:17 PM UTC

Hi Daniele Your code seems to be fine. Can you upload a sample so that we can take a look at what could be causing this? Thanks Arun

Daniele Fusi
Replied On October 29, 2003 12:20 PM UTC

> Your code seems to be fine. Can you upload a sample so that we can take a look at what could be causing this? > > Thanks > Arun Here it is the dummy test project. Thanks in advance!

Arun Srinivasan [Syncfusion]
Replied On October 29, 2003 01:40 PM UTC

Hi Daniele There is an issue with Clear() being called when the scrollbar is visible in the TreeViewAdv control. The Essential Tools team is looking into this issue and we apologize the inconvenience this has caused. Regards, Arun

Daniele Fusi
Replied On October 29, 2003 03:59 PM UTC

Many thanks for your reply; could you please tell me how can I be notified of the fix? Should I just check this forum?


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon