Is it possible to deselect RadTreeList item on OnItemClick (client side) ?

2 posts, 0 answers
  1. Alex R.
    Alex R. avatar
    8 posts
    Member since:
    Jul 2009

    Posted 10 May 2013 Link to this post

    I need to implement functionality to select/deselect item on item click event(client side).
    Single selection mode is used.

    I use

    function ItemClick(sender, eventArgs) {
      if (eventArgs.get_item().get_selected()) {
    // OR THIS ONE
         //var treelist = $find('<%=MyTreeList.ClientID %>');

    But selection is restored every time after OnItemClick  event.

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 30 Aug 2013 Link to this post

    Hi Alex,

    Please take a look into the following code snippet I tried to select/deselect an item on itemclick event.

    <telerik:RadTreeList ID="RadTreeList1" AutoGenerateColumns="true" Height="500px"
        runat="server" DataKeyNames="EmployeeID" ParentDataKeyNames="ReportsTo" OnNeedDataSource="RadTreeList1_NeedDataSource">
            <ClientEvents OnItemClick="ItemClick" />

    <script type="text/javascript">
        function ItemClick(sender, eventArgs) {
            if (eventArgs.get_item().get_selected()) {
                eventArgs.get_item().set_selected(false); //selecting the item on item click
            else {
                eventArgs.get_item().set_selected(true); //deselecting already selected row

  3. DevCraft R3 2016 release webinar banner
Back to Top