Client Side Selection

2 posts, 0 answers
  1. shabbir mohammad
    shabbir mohammad avatar
    7 posts
    Member since:
    Jan 2010

    Posted 21 Apr 2011 Link to this post

    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
  2. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 26 Apr 2011 Link to this post

    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.

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