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

Dose the Tree list have a Context Menu funcationality

1 Answer 83 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Tejas Kan
Top achievements
Rank 1
Tejas Kan asked on 19 Nov 2010, 12:34 AM
Hi ,
I am not sure if the Tree list support a Context Menu function?
If yes could you please provide me a link to an example.

Thanks in advance

Tejas

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 22 Nov 2010, 05:43 PM
Hi Tejas,

Even though RadTreeList does not currently expose its own context menu, you can easily bind a RadContextMenu to RadTreeList. You can refer to a similar demo using RadListView and RadContextMenu. The approach is the same - you use the javascript oncontextmenu event of the tree list items to show a context menu. To attach an client oncontextmenu event handler to the tree list items, you can use the ItemCreated event of the control:

protected void RadTreeList1_ItemCreated(object sender, TreeListItemCreatedEventArgs e)
{
    if (e.Item is TreeListDataItem)
    {
        TreeListDataItem dataItem = (TreeListDataItem)e.Item;
        dataItem.Attributes["oncontextmenu"] = "ShowContextMenu(" + dataItem.DisplayIndex + ");";
    }
}

Veli
the Telerik team
Browse the vast support resources we have to jumpstart 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.
Tags
TreeList
Asked by
Tejas Kan
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or