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

Diabale the Parent Node

4 Answers 64 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
smith
Top achievements
Rank 1
smith asked on 27 Aug 2009, 03:54 PM
HI

 In my scenario  is i am adding all nodes in treevirew using Hierarchcal datasource . i want to disable all the first level Parent  nodes

also avoid editing also and drag drop . how to implement this functionality ?
can u send me some examples.

also i need to delete the Node using context menu some times each node contains sub node also i dont want to delete r the sub node  how to do ?
regards
smith

4 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 28 Aug 2009, 07:23 AM
Hello smith,

You can get all the root level items from the RadTreeView.Items property. To disable them just set the IsEnabled property to false.

About your second question - when you delete a node  - you are deleting its child items also. If you want to keep the child items you should first move them somwhere else in the tree and then to delete the parent node.

I hope this helps!

Kind regards,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
smith
Top achievements
Rank 1
answered on 29 Aug 2009, 01:11 PM
HI 
 
 i want to  avoid drag and drop and  editing my root level first Parents .
so in Itemprepared event setted ISDragOver = false and IsDragBEfore = false.
then also it is not working . only second level child and consequent child  can drag and drop  ..

same as i dont want to edit the parents nodes .. if i set is Enable property = false. whole child also disabled i can not able to expand the child level items.
i tried in Itemprepared event not working above scenarios.
0
Valentin.Stoychev
Telerik team
answered on 31 Aug 2009, 06:36 AM
Hello smith,

You can use the PreviewEditStarted event of the TreeView item to handle it and to stop it for the root items.

All the best,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Valentin.Stoychev
Telerik team
answered on 31 Aug 2009, 06:52 AM
Hello smith,

You can use the PreviewEditStarted event of the TreeView item and to handle it for the root items.

For the Drag and drop you can use the PreviewDragStarted event in the same manner.

All the best,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
TreeView
Asked by
smith
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
smith
Top achievements
Rank 1
Share this question
or