TreeView in Web Custom Control

Discussion in 'ASP .Net' started by Jonas, May 18, 2006.

  1. Jonas

    Jonas Guest

    Hi.
    I'm trying to develop a web custom control that uses a programmatically
    created treeview.
    My problem is that I get an exception when I try to render the control.
    With properties do I have to assign to get this working.
    Here is some sample code:

    namespace WebControlLibrary1
    {
    [ToolboxData("<{0}:MyControl runat=server></{0}:MyControl>")]
    public class MyControl : WebControl
    {
    protected override void RenderContents(HtmlTextWriter output)
    {
    XmlDataSource source = new XmlDataSource();
    source.Data = GetXmlElement().OuterXml;

    TreeView tv = new TreeView();
    tv.ID = ClientID + "_TreeView";
    tv.ImageSet = TreeViewImageSet.XPFileExplorer;
    tv.RenderControl(output);
    }

    private XmlElement GetXmlElement()
    {
    XmlDocument doc = new XmlDocument();
    doc.LoadXml("<Xml><EmptyXml /></Xml>");
    return doc.DocumentElement;
    }
    }
    }


    Best regards
    Jonas Samuelsson
     
    Jonas, May 18, 2006
    #1
    1. Advertising

  2. Gaurav Vaish \(EduJini.IN\), May 19, 2006
    #2
    1. Advertising

  3. Jonas

    Jonas Guest

    Hi,
    here is the exception info:

    System.NullReferenceException was unhandled by user code
    Message="Object reference not set to an instance of an object."
    Source="System.Web"
    StackTrace:
    at System.Web.UI.Control.get_SpacerImageUrl()
    at
    System.Web.UI.WebControls.TreeView.RenderBeginTag(HtmlTextWriter
    writer)
    at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter
    writer)
    at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter
    writer, ControlAdapter adapter)
    at System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    ControlAdapter adapter)
    at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
    at WebControlLibrary1.MyControl.RenderContents(HtmlTextWriter
    output) in C:\Work\WebSite1\WebControlLibrary1\MyControl.cs:line 27
    at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter
    writer)
    at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter
    writer, ControlAdapter adapter)
    at System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    ControlAdapter adapter)
    at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
    at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter
    writer, ICollection children)
    at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
    at
    System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter
    writer)
    at
    System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter
    writer)
    at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter
    output)
    at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter
    writer, ControlAdapter adapter)
    at System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    ControlAdapter adapter)
    at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
    at
    System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter
    writer)
    at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter
    writer, ICollection children)
    at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
    at System.Web.UI.Control.Render(HtmlTextWriter writer)
    at System.Web.UI.Page.Render(HtmlTextWriter writer)
    at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter
    writer, ControlAdapter adapter)
    at System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    ControlAdapter adapter)
    at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
    at System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     
    Jonas, May 22, 2006
    #3
  4. Cryptic only with the exception that SpacerImageUrl is missing.
    Provided any value to it?
    Or may be something coming out of MyControl.cs

    Mail me the relevant code (with aspx) at
    gaurav~DOT~vaish[at]gmail~DOT~com... not sure, but probably may be of some
    help.

    --
    Happy Hacking,
    Gaurav Vaish
    http://www.mastergaurav.org
    http://www.edujini.in
    -------------------


    "Jonas" <> wrote in message
    news:...
    > Hi,
    > here is the exception info:
    >
    > System.NullReferenceException was unhandled by user code
    > Message="Object reference not set to an instance of an object."
    > Source="System.Web"
    > StackTrace:
    > at System.Web.UI.Control.get_SpacerImageUrl()
    > at
    > System.Web.UI.WebControls.TreeView.RenderBeginTag(HtmlTextWriter
    > writer)
    > at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter
    > writer)
    > at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter
    > writer, ControlAdapter adapter)
    > at System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    > ControlAdapter adapter)
    > at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
    > at WebControlLibrary1.MyControl.RenderContents(HtmlTextWriter
    > output) in C:\Work\WebSite1\WebControlLibrary1\MyControl.cs:line 27
    > at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter
    > writer)
    > at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter
    > writer, ControlAdapter adapter)
    > at System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    > ControlAdapter adapter)
    > at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
    > at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter
    > writer, ICollection children)
    > at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
    > at
    > System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter
    > writer)
    > at
    > System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter
    > writer)
    > at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter
    > output)
    > at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter
    > writer, ControlAdapter adapter)
    > at System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    > ControlAdapter adapter)
    > at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
    > at
    > System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter
    > writer)
    > at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter
    > writer, ICollection children)
    > at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
    > at System.Web.UI.Control.Render(HtmlTextWriter writer)
    > at System.Web.UI.Page.Render(HtmlTextWriter writer)
    > at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter
    > writer, ControlAdapter adapter)
    > at System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    > ControlAdapter adapter)
    > at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
    > at System.Web.UI.Page.ProcessRequestMain(Boolean
    > includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    >
     
    Gaurav Vaish \(EduJini.IN\), May 23, 2006
    #4
  5. Jonas

    Prakash V Guest

    Hi ,
    i too got the same problem, i try to render a treecontrol and pass
    the html to some other mehthod, it give object set to null exception, i
    tried many things but cannot do it, i tried to replace get_spacerImageurl()
    but no use. Did anyone have solution for this problem

    part of my code is
    private string RenderTree()

    {


    TreeView Tview = new TreeView();

    TreeNode tnode = new TreeNode("Node1", "1");

    Tview.Nodes.Add(tnode);

    Tview.ID = "Tree1";


    StringBuilder sb = new StringBuilder();

    StringWriter sw = new StringWriter(sb);

    HtmlTextWriter htmlTW = new HtmlTextWriter(sw);

    Tview.RenderControl(htmlTW);

    return sb.ToString();

    }

    and stack trace is [NullReferenceException: Object reference not set to an
    instance of an object.]
    System.Web.UI.Control.get_SpacerImageUrl() +50
    System.Web.UI.WebControls.TreeView.RenderBeginTag(HtmlTextWriter writer)
    +202
    System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +31
    System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,
    ControlAdapter adapter) +74
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter
    adapter) +291
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +49
    TreeviewRender.RenderTree() in
    d:\TestProject\TestProject\TreeviewRender.aspx.cs:30
    TreeviewRender.Page_Load(Object sender, EventArgs e) in
    d:\TestProject\TestProject\TreeviewRender.aspx.cs:17
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o,
    Object t, EventArgs e) +31
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,
    EventArgs e) +68
    System.Web.UI.Control.OnLoad(EventArgs e) +88
    System.Web.UI.Control.LoadRecursive() +74
    System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3030







    "Gaurav Vaish (EduJini.IN)" <> wrote in
    message news:%...
    > Cryptic only with the exception that SpacerImageUrl is missing.
    > Provided any value to it?
    > Or may be something coming out of MyControl.cs
    >
    > Mail me the relevant code (with aspx) at
    > gaurav~DOT~vaish[at]gmail~DOT~com... not sure, but probably may be of some
    > help.
    >
    > --
    > Happy Hacking,
    > Gaurav Vaish
    > http://www.mastergaurav.org
    > http://www.edujini.in
    > -------------------
    >
    >
    > "Jonas" <> wrote in message
    > news:...
    >> Hi,
    >> here is the exception info:
    >>
    >> System.NullReferenceException was unhandled by user code
    >> Message="Object reference not set to an instance of an object."
    >> Source="System.Web"
    >> StackTrace:
    >> at System.Web.UI.Control.get_SpacerImageUrl()
    >> at
    >> System.Web.UI.WebControls.TreeView.RenderBeginTag(HtmlTextWriter
    >> writer)
    >> at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter
    >> writer)
    >> at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter
    >> writer, ControlAdapter adapter)
    >> at System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    >> ControlAdapter adapter)
    >> at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
    >> at WebControlLibrary1.MyControl.RenderContents(HtmlTextWriter
    >> output) in C:\Work\WebSite1\WebControlLibrary1\MyControl.cs:line 27
    >> at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter
    >> writer)
    >> at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter
    >> writer, ControlAdapter adapter)
    >> at System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    >> ControlAdapter adapter)
    >> at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
    >> at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter
    >> writer, ICollection children)
    >> at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
    >> at
    >> System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter
    >> writer)
    >> at
    >> System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter
    >> writer)
    >> at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter
    >> output)
    >> at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter
    >> writer, ControlAdapter adapter)
    >> at System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    >> ControlAdapter adapter)
    >> at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
    >> at
    >> System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter
    >> writer)
    >> at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter
    >> writer, ICollection children)
    >> at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
    >> at System.Web.UI.Control.Render(HtmlTextWriter writer)
    >> at System.Web.UI.Page.Render(HtmlTextWriter writer)
    >> at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter
    >> writer, ControlAdapter adapter)
    >> at System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    >> ControlAdapter adapter)
    >> at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
    >> at System.Web.UI.Page.ProcessRequestMain(Boolean
    >> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    >>

    >
    >
     
    Prakash V, Jun 7, 2006
    #5
  6. I've given a solution to Jonas...
    Just set the value of,... grrr... lost the property name, as empty
    value.

    BRB :)

    --
    Happy Hacking,
    Gaurav Vaish | http://www.mastergaurav.org
    http://www.edujini.in | http://webservices.edujini.in
    -------------------


    "Prakash V" <> wrote in message
    news:...
    > Hi ,
    > i too got the same problem, i try to render a treecontrol and pass
    > the html to some other mehthod, it give object set to null exception, i
    > tried many things but cannot do it, i tried to replace
    > get_spacerImageurl() but no use. Did anyone have solution for this problem
    >
    > part of my code is
    > private string RenderTree()
    >
    > {
    >
    >
    > TreeView Tview = new TreeView();
    >
    > TreeNode tnode = new TreeNode("Node1", "1");
    >
    > Tview.Nodes.Add(tnode);
    >
    > Tview.ID = "Tree1";
    >
    >
    > StringBuilder sb = new StringBuilder();
    >
    > StringWriter sw = new StringWriter(sb);
    >
    > HtmlTextWriter htmlTW = new HtmlTextWriter(sw);
    >
    > Tview.RenderControl(htmlTW);
    >
    > return sb.ToString();
    >
    > }
    >
    > and stack trace is [NullReferenceException: Object reference not set to an
    > instance of an object.]
    > System.Web.UI.Control.get_SpacerImageUrl() +50
    > System.Web.UI.WebControls.TreeView.RenderBeginTag(HtmlTextWriter writer)
    > +202
    > System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +31
    > System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,
    > ControlAdapter adapter) +74
    > System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    > ControlAdapter adapter) +291
    > System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +49
    > TreeviewRender.RenderTree() in
    > d:\TestProject\TestProject\TreeviewRender.aspx.cs:30
    > TreeviewRender.Page_Load(Object sender, EventArgs e) in
    > d:\TestProject\TestProject\TreeviewRender.aspx.cs:17
    > System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o,
    > Object t, EventArgs e) +31
    > System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,
    > EventArgs e) +68
    > System.Web.UI.Control.OnLoad(EventArgs e) +88
    > System.Web.UI.Control.LoadRecursive() +74
    > System.Web.UI.Page.ProcessRequestMain(Boolean
    > includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3030
    >
    >
    >
    >
    >
    >
    >
    > "Gaurav Vaish (EduJini.IN)" <> wrote
    > in message news:%...
    >> Cryptic only with the exception that SpacerImageUrl is missing.
    >> Provided any value to it?
    >> Or may be something coming out of MyControl.cs
    >>
    >> Mail me the relevant code (with aspx) at
    >> gaurav~DOT~vaish[at]gmail~DOT~com... not sure, but probably may be of
    >> some help.
    >>
    >> --
    >> Happy Hacking,
    >> Gaurav Vaish
    >> http://www.mastergaurav.org
    >> http://www.edujini.in
    >> -------------------
    >>
    >>
    >> "Jonas" <> wrote in message
    >> news:...
    >>> Hi,
    >>> here is the exception info:
    >>>
    >>> System.NullReferenceException was unhandled by user code
    >>> Message="Object reference not set to an instance of an object."
    >>> Source="System.Web"
    >>> StackTrace:
    >>> at System.Web.UI.Control.get_SpacerImageUrl()
    >>> at
    >>> System.Web.UI.WebControls.TreeView.RenderBeginTag(HtmlTextWriter
    >>> writer)
    >>> at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter
    >>> writer)
    >>> at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter
    >>> writer, ControlAdapter adapter)
    >>> at System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    >>> ControlAdapter adapter)
    >>> at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
    >>> at WebControlLibrary1.MyControl.RenderContents(HtmlTextWriter
    >>> output) in C:\Work\WebSite1\WebControlLibrary1\MyControl.cs:line 27
    >>> at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter
    >>> writer)
    >>> at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter
    >>> writer, ControlAdapter adapter)
    >>> at System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    >>> ControlAdapter adapter)
    >>> at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
    >>> at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter
    >>> writer, ICollection children)
    >>> at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
    >>> at
    >>> System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter
    >>> writer)
    >>> at
    >>> System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter
    >>> writer)
    >>> at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter
    >>> output)
    >>> at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter
    >>> writer, ControlAdapter adapter)
    >>> at System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    >>> ControlAdapter adapter)
    >>> at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
    >>> at
    >>> System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter
    >>> writer)
    >>> at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter
    >>> writer, ICollection children)
    >>> at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
    >>> at System.Web.UI.Control.Render(HtmlTextWriter writer)
    >>> at System.Web.UI.Page.Render(HtmlTextWriter writer)
    >>> at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter
    >>> writer, ControlAdapter adapter)
    >>> at System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
    >>> ControlAdapter adapter)
    >>> at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
    >>> at System.Web.UI.Page.ProcessRequestMain(Boolean
    >>> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    >>>

    >>
    >>

    >
    >
     
    Gaurav Vaish \(www.EduJini.IN\), Jun 11, 2006
    #6
  7. Jonas

    Jonas Guest

    I got it working by adding the following line:
    treeview.SkipLinkText = "";
    before treeview.RenderControl(writer).

    Thanks alot Gaurav!
     
    Jonas, Jun 12, 2006
    #7
  8. Jonas

    Prakash V Guest

    Hi,
    after adding treeview.SkipLinkText = ""; also it's not working, it now
    expects GetImageUrl. i am giving my code and stack trace below.

    public partial class TreeviewRender : System.Web.UI.Page

    {

    protected void Page_Load(object sender, EventArgs e)

    {

    if (IsPostBack)

    RenderTree();

    }

    private string RenderTree()

    {

    TreeView Tview = new TreeView();

    TreeNode tnode = new TreeNode("Node1", "1");

    Tview.Nodes.Add(tnode);

    Tview.ID = "Tree1";

    Tview.SkipLinkText = "";

    StringBuilder sb = new StringBuilder();

    StringWriter sw = new StringWriter(sb);

    HtmlTextWriter htmlTW = new HtmlTextWriter(sw);

    Tview.RenderControl(htmlTW);

    return sb.ToString();

    }

    }


    Source Error:


    Line 30: StringWriter sw = new StringWriter(sb);
    Line 31: HtmlTextWriter htmlTW = new HtmlTextWriter(sw);
    Line 32: Tview.RenderControl(htmlTW);
    Line 33: return sb.ToString();
    Line 34:


    Source File: d:\TestProject\TestProject\TreeviewRender.aspx.cs Line: 32

    Stack Trace:


    [NullReferenceException: Object reference not set to an instance of an
    object.]
    System.Web.UI.WebControls.TreeView.GetImageUrl(Int32 index) +4107
    System.Web.UI.WebControls.TreeNode.Render(HtmlTextWriter writer, Int32
    position, Boolean[] isLast, Boolean enabled) +2700
    System.Web.UI.WebControls.TreeView.RenderContents(HtmlTextWriter writer)
    +294
    System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +43
    System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,
    ControlAdapter adapter) +74
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter
    adapter) +291
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +49
    TreeviewRender.RenderTree() in
    d:\TestProject\TestProject\TreeviewRender.aspx.cs:32
    TreeviewRender.Page_Load(Object sender, EventArgs e) in
    d:\TestProject\TestProject\TreeviewRender.aspx.cs:18
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o,
    Object t, EventArgs e) +31
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,
    EventArgs e) +68
    System.Web.UI.Control.OnLoad(EventArgs e) +88
    System.Web.UI.Control.LoadRecursive() +74
    System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3034



    Thanks in Advance,
    Prakash.V
    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
    Version:2.0.50727.42

    "Jonas" <> wrote in message
    news:...
    >I got it working by adding the following line:
    > treeview.SkipLinkText = "";
    > before treeview.RenderControl(writer).
    >
    > Thanks alot Gaurav!
    >
     
    Prakash V, Jun 12, 2006
    #8
  9. Jonas

    itaisc

    Joined:
    Oct 9, 2007
    Messages:
    2
    Same problem with treeView Control

    Anyone solved this problem??? please help.
     
    itaisc, Oct 9, 2007
    #9
  10. Jonas

    itaisc

    Joined:
    Oct 9, 2007
    Messages:
    2
    I have a kind of solution...

    What I did is to inherit From TreeView and that gave me all the functionalities of Web control and also cause my control to become a control with TreeView that can be rendered properly.

    Then when I needed to add some more controls like Text Box and Button I just override the "RenderControl" function and add to it's HtmlTextWriter
    my rendered controls.

    Hope that it helped you guys!

    :congrats:
     
    itaisc, Oct 11, 2007
    #10
    1. Advertising

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. Matt Sokol
    Replies:
    2
    Views:
    409
    Theo Tillotson
    Aug 7, 2003
  2. Jonas

    TreeView in Web Custom Control

    Jonas, May 18, 2006, in forum: ASP .Net Building Controls
    Replies:
    4
    Views:
    153
    Prakash V
    Jun 12, 2006
  3. Ionutz
    Replies:
    2
    Views:
    546
    Ionutz
    Oct 23, 2005
  4. Jonas

    TreeView in Web Custom Control

    Jonas, May 18, 2006, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    236
    Prakash V
    Jun 12, 2006
  5. Replies:
    0
    Views:
    217
Loading...

Share This Page