This documentation is archived and is not being maintained.

TreeNodeStyle::ChildNodesPadding Property

Gets or sets the amount of space between a parent node and a child node to which the TreeNodeStyle class is applied.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public:
property Unit ChildNodesPadding {
	Unit get ();
	void set (Unit value);
}

Property Value

Type: System.Web.UI.WebControls::Unit
The amount of space, in pixels, that is above and below the child nodes section of a parent node. The default is 0 pixels.

ExceptionCondition
ArgumentOutOfRangeException

The selected value is of type Percentage or is less than 0.

Use the ChildNodesPadding property to control the amount of space above and below the child nodes section of the node to which the TreeNodeStyle class is applied. This spacing is inserted between the parent node and its first child node, as well as between its last child node and the next node.

NoteNote

The space after the last child node is not rendered if there are no additional nodes following the last child node, because this would leave an unnecessary gap at the bottom of the control.

To control the amount of space between child nodes, use the NodeSpacing property.

The value of this property is stored in view state.

The following code example demonstrates how to use the ChildNodesPadding property to specify the space above and below the child nodes section of a parent node.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: