add a close button against each node

4 posts, 0 answers
  1. Rohan
    Rohan avatar
    13 posts
    Member since:
    Nov 2010

    Posted 28 Jan 2011 Link to this post

    Hi,

    I am binding the RadTReeView from the database. I want to add a image button against each node in RadTreeView. I tried it at the NodeDataBound event. But then the text disappeared and only the image button was showing up.
    On the click of that image button I want to do delete the item from the database.

    Please assist me...


    Thanks
    Rohan
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 28 Jan 2011 Link to this post

    Hello Rohan,


    You could add the Button control in ItemTemplate so that you will be getting the button for each node. Now in the ButtonClick event, get the node by using NamingContainer property and get the node value to update the DB.


    -Shinu.
  3. Rohan
    Rohan avatar
    13 posts
    Member since:
    Nov 2010

    Posted 28 Jan 2011 Link to this post

    Hi Shinu,

    Thanks for replying. You mean to say "NodeTemplate". I used it like this:
    <NodeTemplate>
                            <a style="cursor: pointer; position: absolute;" title="remove" onclick="">
                                <img src="../Content/Images/closenew.png" style="background-color: inherit;" alt="x" />
                            </a>
                        </NodeTemplate>
    but the problem is that, its showing the image button but the text of the node is not there. i.e the nodes I was getting from the database is not there.

    thanks
    rohan
  4. Yana
    Admin
    Yana avatar
    4907 posts

    Posted 31 Jan 2011 Link to this post

    Hi Rohan,

    You should also bind the text of the nodes as demonstrated here.

    Regards,
    Yana
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top