Hide button of child-item

2 posts, 0 answers
  1. Savyo
    Savyo avatar
    75 posts
    Member since:
    Apr 2012

    Posted 16 Nov 2012 Link to this post

    Hi,
         How can I hide the add new button of the child items in the radtreelist with two levels of hierarchy. thanks in advance
    Savyo
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 16 Nov 2012 Link to this post

    Hi Savyo,

    Try the following code snippet to achieve your scenario.

    C#:
    protected void RadTreeList1_ItemDataBound(object sender, TreeListItemDataBoundEventArgs e)
    {
        if (e.Item is TreeListDataItem)
        {
            var dataItem = (TreeListDataItem)e.Item;
            if (dataItem.HierarchyIndex.NestedLevel != 0)
            {
                //specify your edit column's UniqueName here
                dataItem["EditCommandColumn"].Controls[0].Visible = false;
            }
        }
    }

    Hope this helps.

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