System.Web.UI.WebControls Namespace TreeView Class
.NET Framework version 2.0
Sets or retrieves the maximum number of levels in a data source to bind to a TreeView control.
Inline |
<asp:treeview maxdatabinddepth = intValue ... > |
Script |
TreeView.MaxDataBindDepth [ = intValue ] |
intValue |
The maximum depth of tree levels to bind to the TreeView control. |
The property is read/write with a default value of -1, which binds all the tree levels in the data source to the control.
Use the MaxDataBindDepth property to limit the number of node levels in a data source to bind to a TreeView control.
For example, setting this property to 2 binds only the root node and any nodes that are immediately under the root node to the TreeView control. All remaining nodes in the data source are ignored.
NOTE: A malicious user can create a callback request and get data for the nodes of the TreeView control that the page developer is not displaying. Therefore, security of the data must be implemented by the data source. Do not use the MaxDataBindDepth property to hide data.
TreeView Members