Hide delete button on children

2 posts, 1 answers
  1. Chris
    Chris avatar
    15 posts
    Member since:
    Oct 2010

    Posted 16 Dec 2011 Link to this post


    I want to give the users the option of deleting items on a treelist grid, but I only want them to delete a full node. Or, to put it on a single question, is it possible to show a delete button only when Parent ID is null?
  2. Answer
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 19 Dec 2011 Link to this post


    Try the following code snippet.
    protected void RadTreeList1_ItemDataBound(object sender, Telerik.Web.UI.TreeListItemDataBoundEventArgs e)
         if (e.Item is TreeListDataItem)
               TreeListDataItem itm = (TreeListDataItem)e.Item;
               LinkButton btn = (LinkButton)itm["Deletecol"].Controls[0];
               if(//your condition)
                    btn.Visible = false;

  3. DevCraft R3 2016 release webinar banner
Back to Top