all groups > asp.net building controls > february 2006 >
You're in the

asp.net building controls

group:

HierarchicalDataSourceControl Class and System.StackOverflowExcept


HierarchicalDataSourceControl Class and System.StackOverflowExcept Francis Reed
2/28/2006 11:31:28 AM
asp.net building controls:
Hi

When running the example code for the FileSystemDataSource which in found in
the HierarchicalDataSourceControl Class documentation, I get a
System.StackOverflowException. Can someone please help me solve this problem?

http://msdn2.microsoft.com/en-us/library/system.web.ui.hierarchicaldatasourcecontrol.aspx

Thank in advance
RE: HierarchicalDataSourceControl Class and System.StackOverflowExcept DWS
3/2/2006 7:27:37 AM
Francis,
I've used that code as starting point for building a custom
hierarchiacaldatasourcecontrol. Can you give the group a little more
information on the error, like which line of code generated the error maybe.

Thanks
DWS

[quoted text, click to view]
RE: HierarchicalDataSourceControl Class and System.StackOverflowEx Joey Chömpff
4/3/2006 5:55:02 AM
LS,

The following must make it but it isn't an elegant way.
I think there is an bug in designer.

FileSystemDataSourceView fsdsv = new FileSystemDataSourceView();
TreeView1.DataSource = fsdsv.Select();
TreeView1.DataBind();

Greetz,

Joey Chömpff

RE: HierarchicalDataSourceControl Class and System.StackOverflowEx Francis Reed
4/3/2006 6:29:01 AM
Hi

Yes, I tried that too, and it did work. As you said, the other way of
dropping the controls in the designer doesn't work. I hope they fix it soon.

Cheers
Francis

[quoted text, click to view]
RE: HierarchicalDataSourceControl Class and System.StackOverflowEx Joey Chömpff
4/3/2006 6:42:15 AM
RE:HierarchicalDataSourceControl Class and System.StackOverflow super.ronny NO[at]SPAM gmail-dot-com.no-spam.invalid
7/18/2006 5:22:34 PM
I too had the same problems as you describe, and I noticed that
wasn't alone... No help to find online. I solved it, and after doin
so I sent the following email to:'DevDocs@microsoft.com'

[quoted text, click to view]
TreeView control to file system data using the FileSystemDataSourc
example.
[quoted text, click to view]
Class FileSystemDataSource) instead of showing the declarative synta
and binding
[quoted text, click to view]
of this. I made a search on the internet, and it seems I am not th
only one to have problems. The reason for this is that since th
declarative sample is missing, people set it up themselves. And th
easiest declarative setup is to do as follows
[quoted text, click to view]
each folder node, or sometimes worse you get a stack overflo
(depending on the amount of files and folders in the app-root). Btw
if you use a Menu instead of a TreeView it works. And that wa
actually the hint needed to nail this one. I was finally able t
narrow it down to the PopulateNodesFromClient property for th
treeview. PopulateNodesFromClient is true by default, which mean
that the Select will ask for each folder separately (dynamically)
Since the example doesn't use the viewPath for it's select, it alway
starts from the root. Given your example the solution is to explicitl
set PopulateNodesFromClient to false in the declaration, like this
[quoted text, click to view]
id="CatSelector" DataSourceID="ds
PopulateNodesFromClient="false" /
[quoted text, click to view]
viewPath in combination with the select as well. Then it would b
easier to make hierarchical data-sources that allowed for dynamicall
adding nodes (which is after all the default for the TreeVie
control)
[quoted text, click to view]

This email should explain all you need to get this working

Regards
Ronn

---------------------------------
http://community.ihostasp.ne
AddThis Social Bookmark Button