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

    Hi,

    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
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 19 Dec 2011 Link to this post

    Hello,

    Try the following code snippet.
    CS:
    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;
                }
          }
      }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top