09-23-04 02:18 PM
Never mind, I figured it out. Was a STUPID mistake on my part. My class
was called ResourceGallery, therefore was causing problems when trying to
reference the MCMS ResourceGallery method!!
Anyway, here is the basic code, for others who want it!
protected Microsoft.Web.UI.WebControls.TreeView ResourceGalleryTree;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
// Put user code to initialize the page here
ResourceGalleryTree.ShowLines = true;
ResourceGalleryTree.ShowPlus = true;
BuildResourceGalleryTree(CmsHttpContext.Current.RootResourceGallery.Resource
Galleries["Intranet"], null);
}
public void BuildResourceGalleryTree(ResourceGallery
startGallery, TreeNode
parentTreeNode)
{
TreeNode myNewNode = new TreeNode();
myNewNode.NavigateUrl = startGallery.Guid;
myNewNode.Text = startGallery.Name;
// If null, then we are at the root!
if (parentTreeNode == null)
{
// Add the new node
ResourceGalleryTree.Nodes.Add(myNewNode);
}
else
{
// Add our new not to the specified parent node
parentTreeNode.Nodes.Add(myNewNode);
parentTreeNode.Expanded = false;
}
// If sub-channels, recursively call to finish the tree
foreach(ResourceGallery subResourceGallery in
startGallery.ResourceGalleries)
{
BuildResourceGalleryTree(subResourceGall
ery, myNewNode);
}
}
"George Leithead" <george.leithead@davislangdonDINAHSPAMMEH.com> wrote in
message news:4152a04c$0$20246$ed9e5944@reading.news.pipex.net...
> Hi all,
>
> I want to use the R.A.D. editor, however there is a problem with it.
> Basically, when you want to upload a resource, it uses a drop-down list.
> That's not a problem you say, well, actually it is if you have a site
which
> is VERY hierarchical and deep.
>
> I therefore want to change this so that I have a "browse" option to go and
> select the appropriate resource gallery. I've got this all working fine,
> however I'm not sure how to render out the resource gallery as a tree.
>
> Could someone help me get started on this one? There are methods and
> properties such as ResourceGalleryTree, BuildResourceGallery,
> BuildResourceGalleryTree that all look like the right thing, but there is
no
> help on these!
>
> All help is much appreciated!
>
> George Leithead
> RAD Manager
>
>
[ Post a follow-up to this message ]
|