The treeview can do this very easily. First, make sure you add some string
to a treenode's Value property that will allow you to determine what node you
are dealing with and what data you need to get out of the database to create
its child nodes. Next, set ExpandDepth to 0, make sure EnableClientScript is
true, and PopulateNodesFromClient is true. Lastly, add an event handler in
your webpage for the TreeNodePopulate event. When that event fires, check in
the event args for a treenode. Get the Value from it and retrieve the
specified data from the database. lastly, create child nodes from this data
and add them to this node's .Children property.
All this happens without a postback to the web server; the user just sees a
slight delay and then the nodes come.
"Ray Booysen" wrote:
Hi all
I have a treeview bound to a sitemap. Once the user is logged in, I'm
wanting the menu to expand to include additional items from a database
while retaining the items in the sitemap. Is this possible.
For example.
My menu has an item called "Books" defined in the sitemap. Once the
user logs in, I want sub menu-items to be created under books with all
the books the user owns. This would be pulled from the database.
Any ideas?
Kind Regards
Ray