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
    control?

    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
    information.
    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
    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" wrote:

    > Hello All,
    >
    > What is the proper way to add a TreeView, with child nodes, to a server
    > control?
    >
    > 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
    > information.
    > Which means i cannot use any of the standard ImageSets and must define all
    > of my own plus signs and dashed lines?
     
    cageman, Mar 19, 2007
    #2
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthew Louden
    Replies:
    1
    Views:
    7,652
    Scott M.
    Oct 11, 2003
  2. Mark Goldin

    Errors, errors, errors

    Mark Goldin, Jan 17, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,278
    Mark Goldin
    Jan 17, 2004
  3. frog
    Replies:
    4
    Views:
    830
    =?Utf-8?B?V2lsbA==?=
    May 18, 2005
  4. keithb
    Replies:
    0
    Views:
    385
    keithb
    May 17, 2006
  5. Ionutz
    Replies:
    2
    Views:
    831
    Ionutz
    Oct 23, 2005
  6. AndrewF
    Replies:
    1
    Views:
    488
  7. Athan

    Treeview Control - Display errors

    Athan, Dec 20, 2005, in forum: ASP General
    Replies:
    0
    Views:
    232
    Athan
    Dec 20, 2005
  8. Philip Herlihy
    Replies:
    1
    Views:
    182
    Philip Herlihy
    Dec 31, 2003
Loading...