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

Delete middel node in sql

3 Answers 46 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Herman
Top achievements
Rank 1
Herman asked on 03 Aug 2011, 11:48 AM
Please give code example on

I populate my treeview from sql example
Column Name : ID
Column Name : Catalogue
Column Name : ParentID

Data

1    Cataloge1      null
2.   Catalogue2    1
3.   Catalogue3    2

The tree look like this
  
  • Catalogue1

              Catalogue2
                       Catalogue3
I want to delete the middel node "Catalogue2" then node 3 "Catalogue3" must move 1 up so the tree just have 2 nodes
    

  • Catalogue1

              Catalogue3
How do i do this when treeview is populated from sql  

    

3 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 03 Aug 2011, 04:39 PM
Hello Herman,

 Here is a nice and complete overview of Binding in RadTreeView: http://www.telerik.com/help/aspnet-ajax/treeview-data-binding-overview.html

The binding in all navigational controls in RadControls for ASP.NET AJAX is single-directional.
You need to manually apply changes to your data source on the proper events.

For example if you delete nodes using the context menu of RadTreeView, then you can handle the ContextMenuItemClicked server event (attaching the handler in the declaration of the TreeView - e.g. <telerik:RadTreeView runat="server" ID="RadTreeView1" ... OnContextMenuItemClicked="RadTreeView1_ContextMenuItemClicked"...>...</telerik:RadTreeView>) and query the data source accordingly.

I hope this helps.

Regards,
Nikolay Tsenkov
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Herman
Top achievements
Rank 1
answered on 03 Aug 2011, 07:24 PM
Sorry still don't come right please see if you can help me with some code
0
Herman
Top achievements
Rank 1
answered on 04 Aug 2011, 04:14 PM
never mind got i working with a store procedure
Tags
TreeView
Asked by
Herman
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Herman
Top achievements
Rank 1
Share this question
or