TreeNodeBinding.ShowCheckBox Property
Assembly: System.Web (in system.web.dll)
public: property Nullable<bool> ShowCheckBox { Nullable<bool> get (); void set (Nullable<bool> value); }
/** @property */ public Nullable<boolean> get_ShowCheckBox () /** @property */ public void set_ShowCheckBox (Nullable<boolean> value)
public function get ShowCheckBox () : Nullable<boolean> public function set ShowCheckBox (value : Nullable<boolean>)
Not applicable.
Property Value
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>
Note: