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

how can i allow user select only child note

1 Answer 49 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Teoman
Top achievements
Rank 1
Teoman asked on 27 Sep 2011, 06:01 AM
hi,
i dont want to permit user select main nodes.i want to permit only child nodes.how can i do this?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 27 Sep 2011, 10:02 AM
Hello,

Try the following things.

  • Hook OnClientNodeClicking event.
  • check for the node level.
  • Cancel the event if the node is parent.
    function OnClientNodeClicking(sender, args)
    {
      if (args.get_node().get_level() == 0)
          {
               args.set_cancel(true);
          }
     }
Thanks,
Shinu.
Tags
TreeView
Asked by
Teoman
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or