TreeNodeBinding::ShowCheckBox Property
Gets or sets a value indicating whether a check box is displayed next to a node to which the TreeNodeBinding object is applied.
Assembly: System.Web (in System.Web.dll)
public: property Nullable<bool> ShowCheckBox { Nullable<bool> get (); void set (Nullable<bool> value); }
Property Value
Type: System::Nullable<Boolean>true to display a check box next to a node to which the TreeNodeBinding object is applied; otherwise, false. The default is false.
To provide multinode selection support in the TreeView control, you can display check boxes next to an image in the node. When the TreeView control is bound to a data source, use the ShowCheckBox property to specify the value to bind to the ShowCheckBox property of a TreeNode object. This binding relationship affects all TreeNode objects to which the TreeNodeBinding object is applied. The ShowCheckBox property is used to show or hide the check box for a node.
Note: |
|---|
Although the ShowCheckBox property can be used to display check boxes, it is more common to use the ShowCheckBoxes property of the TreeView control. However, the ShowCheckBoxes property affects every node type that is specified by the property; therefore, the ShowCheckBox property is often used to override that setting for a node to which the TreeNodeBinding object is applied. You can selectively override the ShowCheckBox property by setting the ShowCheckBox property of each node directly. |
The value of this property is stored in view state.
This section contains two code examples. The first code example demonstrates how to use the ShowCheckBox property to specify whether a check box is displayed for a node. The second code example provides sample XML data for the first code example.
The following example demonstrates how to use the ShowCheckBox property to specify whether a check box is displayed for a node. For this example to work correctly, you must copy the sample XML data, provided after this code example, to a file named Book.xml.
The following code example provides sample XML data for the preceding code example.
<Book Title="Book Title">
<Chapter Heading="Chapter 1">
<Section Heading="Section 1">
</Section>
<Section Heading="Section 2">
</Section>
</Chapter>
<Chapter Heading="Chapter 2">
<Section Heading="Section 1">
</Section>
</Chapter>
<Appendix Heading="Appendix A">
</Appendix>
</Book>
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note: