This is a migrated thread and some comments may be shown as answers.

Use different add button icon for child's EditCommandColumn

2 Answers 117 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Dean
Top achievements
Rank 1
Dean asked on 16 Nov 2018, 02:34 PM
Would it be possible to use a different icon for the EditCommand of children? In my attached screenshot, I would like the top level to stay the same with a "+" symbol, but I would like to replace the children icons with something else.

2 Answers, 1 is accepted

Sort by
0
Dean
Top achievements
Rank 1
answered on 16 Nov 2018, 04:46 PM

My idea so far is in the code behind, I would access the ItemCreated property of the RadTreeList and based on the DataItemIndex/HierarchyIndex, I would select a different icon.

How would I access the icon through the code behind?

0
Rumen
Telerik team
answered on 21 Nov 2018, 12:48 PM
Hi Eric, 

Please check the following forum thread which will show you how to get access to the icons of the child nodes (nested levels): How to remove Plus(Add) button from Child Nodes?, e.g.

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] ...
        }
    }
}


Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
TreeList
Asked by
Dean
Top achievements
Rank 1
Answers by
Dean
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or