TreeView in server control throws errors...

Discussion in 'ASP .Net Building Controls' started by cageman, Mar 8, 2007.

  1. cageman

    cageman Guest

    Hello All,

    What is the proper way to add a TreeView, with child nodes, to a server

    I was getting two errors. The first was quickly resolved by setting the
    SkipLinkText = String.Empty;

    The second one, however, doesn't appear to be as straight forward. When you
    envoke the RenderControl method of the TreeView it loses it's image
    Which means i cannot use any of the standard ImageSets and must define all
    of my own plus signs and dashed lines?
    cageman, Mar 8, 2007
    1. Advertisements

  2. cageman

    cageman Guest

    Figured out my problem...

    A TreeView needs to be added through the CreateChildControls()method,
    this.controls.add(treeview), of a Server control. You cannot add it by
    overriding the Render method and Calling TreeView.Render(output);

    A gridview also needs to be added to your server control via
    CreateChildControls(), this.Controls.Add(gridview), or row buttons will not
    handle click events.
    cageman, Mar 19, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.