RadTreeView for ASP.NET

SelectedNode is empty Send comments on this topic.
See Also
TroubleShooting > SelectedNode is empty

Glossary Item Box

When you add TreeNodes on the client-side (via ExpandMode.ServerSideCallBack), you should take into account that the nodes are not persisted on the server-side. Therefore, the nodes added this way cannot take part in any server-side events. Also, you cannot access the nodes on the server-side and change their properties. The nodes are accessible only on the client-side and can take part only in client-side events. Therefore, the SelectedNode might be null if the selected node is added via callback.

If you need to access the nodes (SelectedNode included) on the server-side, then you should definitely use ExpandMode.ServerSide. Furthermore, you can wrap the treeview with an AJAX Panel (Telerik RadAjax) that will transform each postback into a callback. Thus you will keep the needed client-side behavior.

See Also