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

Client Side Selection

1 Answer 70 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
shabbir mohammad
Top achievements
Rank 1
shabbir mohammad asked on 21 Apr 2011, 10:23 PM
Hi

I would like to allow/disallow selection based on the level of the tree. For example, if it is less then level 3 then I would like to prevent users from selecting.

I would really appreciate any help on this matter

Thanks
Biru

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 26 Apr 2011, 02:19 PM
You can use RadTreeList's client-side OnItemSelecting event to cancel the selection based on the target item's hierarchical index:

<telerik:RadTreeList ID="RadTreeList1" runat="server">
    <ClientSettings>
        <Selecting AllowItemSelection="true" />
        <ClientEvents OnItemSelecting="itemSelecting" />
    </ClientSettings>
</telerik:RadTreeList>

function itemSelecting(sender, args)
{
    var item = args.get_item();
    var hIndex = item.get_hierarchicalIndex();
    if (hIndex.NestedLevel < 2)
    {
        args.set_cancel(true);
    }
}

Veli
the Telerik team

Browse the vast support resources we have to jump start 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
shabbir mohammad
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or