[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Collapse]Tree List
   [Expand]Product Information
   [Collapse]Feature Center
    [Expand]Data Binding
    [Expand]Nodes
    [Expand]Data Editing
    [Expand]Data Presentation
    [Expand]Sorting
    [Expand]Filtering
    [Expand]Summaries
    [Expand]Appearances and Look And Feel
    [Collapse]Focus, Selection and Navigation
      Focus and Navigation
      Node Selection
      Breadcrumb Navigation
      Node Checking - Checkboxes and Radio Buttons
      Scrollbar Annotations
     Formatting Cell Values
    [Expand]Miscellaneous
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]Examples
   [Expand]End User Capabilities
   [Expand]Member Tables
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Node Checking - Checkboxes and Radio Buttons

To select nodes, use the node checking feature, which enables built-in check boxes or radio buttons for tree levels. In bound mode, you can sync node check states with a database field. This document explains this subject in detail.

Tip

To select nodes by highlighting them, use the Node Selection feature.

The following sections are covered in this topic.

Expanded Enable Checkboxes/Radio Buttons

Show check boxes/radio buttons for all nodes

Set the TreeListOptionsView.CheckBoxStyle property to Check or Radio.

Tip

Radio buttons are mutually exclusive options. When you check a certain radio button, the TreeList automatically unchecks a previously checked radio button at the same hierarchy level.

The TreeListOptionsView.CheckBoxStyle property specifies default check box display mode for all TreeList nodes. You can override this setting for root nodes and any node's children, as shown below.

Show check boxes/radio buttons only for root nodes

Set the TreeListOptionsView.RootCheckBoxStyle property to Check or Radio. Leave the TreeListOptionsView.CheckBoxStyle property set to Default.

Show check boxes/radio buttons for all nodes, except root nodes

Set TreeListOptionsView.CheckBoxStyle to Check/Radio, and set TreeListOptionsView.RootCheckBoxStyle to None.

Show/hide check boxes/radio buttons for a certain node's children

Use a node's TreeListNode.ChildrenCheckBoxStyle property. This property overrides the TreeListOptionsView.CheckBoxStyle setting for the specified node's children.

Note

It is not possible to simultaneously display radio buttons and check boxes at the same hierarchy level.

Related API

Expanded Indeterminate Check State

Regular check boxes allow an end-user to toggle between the Checked and Unchecked states. If you enable the TreeListOptionsBehavior.AllowIndeterminateCheckState property, then the TreeList nodes will support three check states (Unchecked, Indeterminate and Checked). Clicking a check box sequentially toggles between these states.

Related API

Expanded Get Nodes with Checked/Unchecked/Indeterminate States

To retrieve all checked nodes, use the TreeList.GetAllCheckedNodes method.

The following code shows how to retrieve checked nodes using the TreeList.GetAllCheckedNodes method, and modify their values.

You can recursively retrieve nodes that match a certain condition (for instance, unchecked nodes or nodes with the indeterminate state) using a node iterator.

The following example shows how to use a node iterator to retrieve unchecked TreeList nodes.

Expanded Obtain and Set Node Check States. Recursive Checking.

Use the following members to specify node check states in code.

Recursive Checking

To check/uncheck child nodes when an end-user toggles a parent node's check state, use the TreeListOptionsBehavior.AllowRecursiveNodeChecking property.

Expanded Example

Expanded Sync Check States with Data Source

Use the TreeList.CheckBoxFieldName property to sync node check states with a specific data source field.

If TreeList nodes only support the checked and unchecked states, the bound data source field should be of the Boolean type. If TreeList nodes use three check states, the data source field should be of the Nullable Boolean type.

Expanded Perform Custom Actions on Node Checking

Expanded Custom Paint Check Boxes

You can custom paint check boxes by handling the TreeList.CustomDrawNodeCheckBox event.

Expanded Printing/Export

To print/export check boxes, enable the TreeListOptionsPrint.PrintCheckBoxes option.

Is this topic helpful?​​​​​​​