New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Migrating from RadTreeView for ASP.NET to ASP.NET AJAX

RadTreeView for ASP.NET AJAX contains a number of changes from moving to the ASP.NET Ajax framework and to the Telerik.Web.UI suite.These changes are listed below:

Client-Side Changes

RadTreeView

RadTreeView Client-Side Object - "Classic"RadTreeView Client-Side Object for ASP.NET AJAX
Methods
FindNodeByTextfindNodeByText()
FindNodeByValuefindNodeByValue()
FindNodeByAttributefindNodeByAttribute()
GetSelectedNodesget_selectedNodes()
UnSelectAllNodesunselectAllNodes()
UpdateStateN/A (no longer required)
HideContextMenuN/A (other API will be provided for Context Menu handling)
Properties
Nodesget_nodes()The return value is no longer an Array. The return value is now a Telerik.Web.UI.RadTreeNodeCollection object.Enumerating Nodes:<script type=”text/javascript”>for (var i=0; i<tree.get_nodes().get_count();i++){var node = tree.get_nodes().getNode(i);alert(node.get_text());}</script>
AllNodesget_allNodes()The return value is Array.
IDget_id()
SelectedNodeget_selectedNode()

RadTreeNode

RadTreeNode Client-Side Object - "Classic"RadTreeNode Client-Side Object for ASP.NET AJAX
Methods
Prevget_previousNode()
Nextget_nextNode()
Expandset_expanded(true) or expand()
Collapseset_expanded(false) or collapse()
Toggletoggle()
Highlighthighlight()
Selectset_selected(true) or select()
UnSelectset_selected(false) or unselect()
Enableset_enabled(true) or enable()
Disableset_enabled(false) or disable()
Checkset_checked(true) or check()
UnCheckset_checked(false) or uncheck()
StartEditstartEdit()
EndEditendEdit()
CheckElementget_checkBoxElement()
ScrollIntoViewscrollIntoView()
ImageElementget_imageElement()
TextElementget_textElement()
get_contentElement()Returns an HTML DOM element (a <LI> tag) that represents a Tree Node.
Properties
Textget_text()
Valueget_value()
Categoryget_category()
Enabledget_enabled()
Expandedget_expanded()
Checkedget_checked()
Selectedget_selected()
Nodesget_nodes()
Parentget_parent()This method will return the RadTreeView if the Node is root Node.
TreeViewget_treeView()
Attributesget_attributes(), getAttribute() and setAttribute()

RadTreeNodeCollection New Methods

See RadTreeNodeCollection Object for more details.

RadTreeNodeCollection Client-Side Object for ASP.NET AJAX
add
insert
remove
removeAt
get_count
getNode
indexOf

Server-Side Changes

RadTreeView Changes

RadTreeView - "Classic"RadTreeView for ASP.NET AJAX
Properties
AfterClientFocusOnClientFocused
BeforeClientContextMenuOnClientContextMenuShowing
BeforeClientClickOnClientNodeClicking
AfterClientClickOnClientNodeClicked
AfterClientCallBackErrorOnClientCallbackError
BeforeClientHighlightOnClientMouseOver
AfterClientHighlightOnClientMouseOver
BeforeClientDoubleClickOnClientDoubleClicking
AfterClientMouseOutOnClientMouseOut
AfterClientEditOnClientNode
BeforeClientDropOnClientNodeDropping
AfterClientDropOnClientNodeDropped
BeforeClientContextClickOnClientContextClicking
BeforeClientCheckOnClientNodeChecking
AfterClientCheckOnClientNodeChecked
BeforeClientDragOnClientNodeDragStart
AfterClientMoveOnClientNodeDragging
AppendDataBoundNodesAppendDataBoundItems
NodeBoundNodeDataBound
Types
LoadingMessagePositionTreeViewLoadingStatusPosition

RadTreeView Deleted Methods and Properties

Deleted Method or PropertyDescription
ContentFileUse the LoadContentFile method instead.
AjaxUrl
ContextMenuContentFileReplaced by newcontext menus
AutoPostBackPostback appears as soon as you hook on any server event requiring postback
AutoPostBackOnCheckSubscribing to the NodeCheck event will enable postback for checking operations
GetContextMenusXmlReplaced by newcontext menus
LoadContextMenusXmlStringReplaced by newcontext menus
OnClientNodeToggling / ToggledReplaced by OnClientNodeExpanding, OnClientNodeExpanded, OnClientNodeCollapsing, OnClientNodeCollapsed events
SSLTreeview output is SSL compliant by default
ImagesBaseDirThe user would specify the whole path
RetainScrollPositionThis feature is on by default
IsCallbackUse Page.IsCallBack instead
LoadingMessageCssClassNow controlled by the skin css styles
AfterClientFocusUse the 'onfocus' attribute for the same purpose.

RadTreeView Changed Return Types

 

Changed Return Type for MethodDescription
GetAllNodesReturns IList<RadTreeNode> instead of ArrayList
CheckedNodesReturns IList<RadTreeNode> instead of ArrayList
SelectedNodesReturns IList<RadTreeNode> instead of ArrayList

RadTreeViewEventHandler

RadTreeViewEventHandler has been split into other delegates:

  1. RadTreeViewEventHandler is used by the following events:

    • NodeClick
    • NodeDataBound
    • NodeCreated
    • NodeExpand
    • NodeCollapse
    • NodeCheck
  2. RadTreeViewDragDropEventHandler is used only by the NodeDrop event

  3. RadTreeViewEditEventHandler is used only by the NodeEdit event

RadTreeNode Changes

 

RadTreeNode - "Classic"RadTreeNode for ASP.NET AJAX
Properties
CssClassSelectSelectedCssClass
ImageExpandedUrlExpandedImageUrl
ParentParentNode
EditEnabledAllowEdit
DragEnabledAllowDrag
DropEnabledAllowDrop

RadTreeNodeEventArgs

That class has been split into other classes:

  1. RadTreeNodeEventArgs contains only one property - Node. It is used by the following events:

    • NodeClick
    • NodeDataBound
    • NodeCreated
    • NodeExpand
    • NodeCollapse
    • NodeCheck
  2. RadTreeNodeDragDropEventArgs is used solely by the NodeDrop event. It contains the following properties:

    • SourceDragNode
    • DestDragNode
    • DropPosition
    • HtmlElementID
  3. RadTreeNodeEditEventArgs is used solely by the NodeEdit event. It contains the following properties

    • Node
    • Text