Skip to main content
A newer version of this page is available. .
Tab

TreeViewNode.Checked Property

Gets or sets whether the node is checked.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.1.dll

Declaration

[DefaultValue(false)]
public virtual bool Checked { get; set; }

Property Value

Type Default Description
Boolean **false**

true if the node is checked; otherwise, false.

Remarks

Use the Checked property to specify whether the node is checked.

TreeView_Checked

To allow end-users to check nodes, set the ASPxTreeView.AllowCheckNodes property to true. You can disable the check box for a particular node, by setting its TreeViewNode.AllowCheck property to false.

To get or set the Checked property value on the client side, use the ASPxClientTreeViewNode.GetChecked and ASPxClientTreeViewNode.SetChecked properties respectively.

Note

The Checked property synchronizes its value with the node’s TreeViewNode.CheckState property.

For more information, see the Check Box Support topic.

Example

This example demonstrates how you can use the ASPxTreeView's AllowCheckNodes and TreeViewNode's AllowCheck properties to manage the visibility of check boxes.See also:TreeView - How to manage the visibility of check boxes via the AllowCheck property

<dx:ASPxRadioButtonList ID="ASPxRadioButtonList1" runat="server" 
    AutoPostBack="True" ClientIDMode="AutoID" 
    onselectedindexchanged="ASPxRadioButtonList1_SelectedIndexChanged" 
    SelectedIndex="0">
    <Items>
        <dx:ListEditItem Text="Hide all check boxes" Value="HideAll" />
        <dx:ListEditItem Text="Show check boxes for leaf nodes only" Value="ShowLeaves" />
        <dx:ListEditItem Text="Show all check boxes" Value="Show" />
    </Items>
</dx:ASPxRadioButtonList>


<dx:ASPxTreeView ID="ASPxTreeView1" runat="server" ClientIDMode="AutoID">
    <Nodes>
        <dx:TreeViewNode>
            <Nodes>
                <dx:TreeViewNode>
                    <Nodes>
                        <dx:TreeViewNode>
                        </dx:TreeViewNode>
                        <dx:TreeViewNode>
                        </dx:TreeViewNode>
                    </Nodes>
                </dx:TreeViewNode>
                <dx:TreeViewNode>
                </dx:TreeViewNode>
            </Nodes>
        </dx:TreeViewNode>
        <dx:TreeViewNode>
            <Nodes>
                <dx:TreeViewNode>
                </dx:TreeViewNode>
                <dx:TreeViewNode>
                </dx:TreeViewNode>
                <dx:TreeViewNode>
                </dx:TreeViewNode>
                <dx:TreeViewNode>
                </dx:TreeViewNode>
            </Nodes>
        </dx:TreeViewNode>
    </Nodes>
</dx:ASPxTreeView>
         <br />
         <br />
         <dx:ASPxButton ID="ASPxButton1" runat="server" OnClick="ASPxButton1_Click" Text="Disable checked nodes">
         </dx:ASPxButton>
         <br />
         <dx:ASPxButton ID="ASPxButton2" runat="server" OnClick="ASPxButton2_Click" Text="Enable checked nodes">
         </dx:ASPxButton>
See Also