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
> Hi
>
[quoted text clipped - 6 lines]
> Thank in advance
> Francis
Joey Chömpff - 03 Apr 2006 13:55 GMT
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
Francis Reed - 03 Apr 2006 14:29 GMT
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
> LS,
>
[quoted text clipped - 8 lines]
>
> Joey Chömpff
Joey Chömpff - 03 Apr 2006 14:42 GMT
That's strange and you have implemented it in the pageload?
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'
> (subject: Documentation Feedback:HierarchicalDataSourceContro
Class
> You seem to have an error in your documentation for the example o
the HierarchicalDataSourceControl class
> In the bottom part of the example you state
> "The following code example demonstrates how to declaratively bind
TreeView control to file system data using the FileSystemDataSourc
example.
> And then you erroneously repeat a previously defined class (Publi
Class FileSystemDataSource) instead of showing the declarative synta
and binding
> Note: I had huge problems with getting your example working becaus
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
> <csp:FileSystemDataSource runat="server
id="ds" /
> <asp:TreeView runat="server
id="CatSelector" DataSourceID="ds" /
> But, this fails miserably! The first level data gets repeated fo
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
> [code:1:1aa4889fea
> <csp:FileSystemSetDataSource runat="server
id="ds" /
> <asp:TreeView runat="server
id="CatSelector" DataSourceID="ds
PopulateNodesFromClient="false" /
> [/code:1:1aa4889fea
>
> BTW: It would be nice if you included an example of how to us
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)
This email should explain all you need to get this working
Regards
Ronn
---------------------------------
http://community.ihostasp.ne
ASP.NET Developer Community