Prevent a node from being selected.

3 posts, 0 answers
  1. Sylvain
    Sylvain avatar
    4 posts
    Member since:
    Nov 2007

    Posted 19 Nov 2007 Link to this post

    Hiya,

    I'm currently evaluating the controls and I like what I see so far.

    I'm testing out the RadTreeView and for the life of me, can't find anything that would easily let me prevent a node from being selected.  There is a BeforeSelect event that I handle but that doesn't have a Cancel property in the RadTreeViewEventArgs.

    In the MS TreeView, you simply set e.Cancel = true and done, the new node doesn't get selected.

    Any suggestions would be greatly appreciated.

    Cheers,
    Sylvain
  2. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 20 Nov 2007 Link to this post

    Hi Sylvain,

    Thank you for writing.

    The BeforeSelect event is obsolete. Please, use the Selecting event of RadTreeView in the way shown in the codeblock below:

    void radTreeView1_Selecting(object sender, RadTreeViewCancelEventArgs e) 
            { 
                if (e.Node.Text.Contains("Personal")) 
                { 
                    e.Cancel = true
                } 
            } 

    If you have any additional questions, please contact us.

    Regards,
    Jordan
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Sylvain
    Sylvain avatar
    4 posts
    Member since:
    Nov 2007

    Posted 20 Nov 2007 Link to this post

    Wow.  Very impressed with the quick response.

    As it turns out, I wasn't using the latest version of the controls.  Downloaded them this morning and presto, works like a charm :)

    Cheers,
    Sylvain
Back to Top