Preventing checkbox checkes when click on node label

6 posts, 1 answers
  1. Marut
    Marut avatar
    15 posts
    Member since:
    Dec 2007

    Posted 08 Apr 2014 Link to this post

    Hi all , 

    First of all I have to apologise about my English . Hope you guys understand what I'm trying to explain .

    I have a tree view with checkboxes .  We implemented node clicks to show the detail right next to the tree and the second click for editing node's name


    The problem is we used to stick with the previous telerik version and we just upgraded to the latest version recently 

    Right now it behaves totally like a checkbox and I know it's kindda make sense. 

    But we are trying to find the way to disable the CLICK on node label . 

    Is there any workaround for this?


    Thank you so much in advance 




  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Apr 2014 in reply to Marut Link to this post

    Hi Marut,

    The default behavior of the control is like that it will not check the CheckBox by clicking on the label of the RadTreeNode. Please have a look into this online demo and try to replicate the issue in this or please provide a sample code where I can reproduce the issue for further help.

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Marut
    Marut avatar
    15 posts
    Member since:
    Dec 2007

    Posted 09 Apr 2014 in reply to Shinu Link to this post

    Hi Shinu,

    I attached the example to show you how it's like below.
    https://www.dropbox.com/s/10onn3watnrq1r5/TreeWthChk.zip

    I enabled AllowEditing property.

    You will see that the first click doesn't do anything apart from making a selection to the node.

    Then the second click will make the node goes to edit mode AND CHECKBOX ALSO CHECKED AT THE SAME TIME. 

    What I want is when we make a second click I want it just goes to edit mode only . Not checking checkbox.

    Do you have any suggestion or some workaround for me?


    Kind regard and really appreciate for you last quick reply

    Have a good day.
  5. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Apr 2014 in reply to Marut Link to this post

    Hi Marut,

    As a work around please try to attach the OnClientNodeClicked and OnClientNodeChecking event of RadTreeView as follows.

    JavaScript:
    var checkboxFlag = 0;
    function OnClientNodeClicked(sender, args) {
        checkboxFlag = 1;
    }
    function OnClientNodeChecking(sender, args) {
        if (checkboxFlag == 1) {
            args.set_cancel(true);
            checkboxFlag = 0;
        }
    }

    Thanks,
    Shinu.
  6. Marut
    Marut avatar
    15 posts
    Member since:
    Dec 2007

    Posted 09 Apr 2014 in reply to Shinu Link to this post

    Thanks a million Shinu

    I will try now and will let you know.

    Have a wonderful day.

  7. Marut
    Marut avatar
    15 posts
    Member since:
    Dec 2007

    Posted 09 Apr 2014 in reply to Shinu Link to this post

    Thank you Shinu,

    It's working as expected. You are the man.


    Have a nice day.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017