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

Prevent a node from being selected.

2 Answers 108 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Sylvain
Top achievements
Rank 1
Sylvain asked on 20 Nov 2007, 05:13 AM
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 Answers, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 20 Nov 2007, 02:36 PM
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
0
Sylvain
Top achievements
Rank 1
answered on 20 Nov 2007, 10:08 PM
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
Tags
Treeview
Asked by
Sylvain
Top achievements
Rank 1
Answers by
Jordan
Telerik team
Sylvain
Top achievements
Rank 1
Share this question
or