RadTreeNode with Image

4 posts, 0 answers
  1. Venkata
    Venkata avatar
    126 posts
    Member since:
    Nov 2009

    Posted 14 Jan 2015 Link to this post

    Hello,
    I want to create TreeNodes with images(NodeText + Image)
    Here is something like...
    Private void LoadNodes()
    {
      RadTreeView.Nodes.Clear();
      RadTreeNode node1 = new RadTreeNode();
      node1 = new RadTreeNode("Node Text" + Image with client Click event, "Node Value")                       node1 .Attributes.Add("IsFirstLevel", "Yes");                                                                                         RadTreeView.Nodes.Add(node1 );
    }

    How can i do?
  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    829 posts

    Posted 15 Jan 2015 Link to this post

    Hello,

    If you want to add a new child node with an image and text displayed you can do the following:

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            RadTreeNode root1 = new RadTreeNode("root1");
            RadTreeNode root2 = new RadTreeNode("root2");
            RadTreeNode child1 = new RadTreeNode("child1");
            child1.ImageUrl = "~/Images/telerik.png";
            root2.Nodes.Add(child1);
            RadTreeView1.Nodes.Add(root1);
            RadTreeView1.Nodes.Add(root2);
        }
    }

    This creates two root items and adds a child item to "root2", passing the image path to the ImageUrl property of "child1". Then we add the root items to the RadTreeView control.

    Regards,
    Ivan Danchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Venkata
    Venkata avatar
    126 posts
    Member since:
    Nov 2009

    Posted 16 Jan 2015 in reply to Ivan Danchev Link to this post

    Hello,
    I know that is the simple way display Image + Text 

    But my question was, I want to Text First then Image ( Text + Image). add Onlick client event to Image 

    Thank you
  5. Ivan Danchev
    Admin
    Ivan Danchev avatar
    829 posts

    Posted 19 Jan 2015 Link to this post

    Hello,

    The following forum discussion shows how you can change the place of the image using jQuery with RadTreeView control.

    Regards,
    Ivan Danchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top