Back to Devexpress

TreeListOptionsView.CheckBoxStyle Property

windowsforms-devexpress-dot-xtratreelist-dot-treelistoptionsview-2ecd2545.md

latest5.0 KB
Original Source

TreeListOptionsView.CheckBoxStyle Property

Gets or sets whether all TreeList nodes should display check boxes, radio buttons, or neither.

Namespace : DevExpress.XtraTreeList

Assembly : DevExpress.XtraTreeList.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

csharp
[DefaultValue(DefaultNodeCheckBoxStyle.Default)]
[XtraSerializableProperty]
public virtual DefaultNodeCheckBoxStyle CheckBoxStyle { get; set; }
vb
<DefaultValue(DefaultNodeCheckBoxStyle.Default)>
<XtraSerializableProperty>
Public Overridable Property CheckBoxStyle As DefaultNodeCheckBoxStyle

Property Value

TypeDefaultDescription
DevExpress.XtraTreeList.DefaultNodeCheckBoxStyleDefault

A DevExpress.XtraTreeList.DefaultNodeCheckBoxStyle enumerator value that specifies the type of content displayed by nodes. The Default value means nodes display neither check boxes, nor radio buttons.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to CheckBoxStyle
TreeList

.OptionsView .CheckBoxStyle

|

Remarks

You can override the CheckBoxStyle setting for specific nodes. To do that, use the TreeListOptionsView.RootCheckBoxStyle and TreeListNode.ChildrenCheckBoxStyle properties.

See Node Checking - Checkboxes and Radio Buttons to learn more.

Demo: Select With Radio Buttons and Check Boxes module in the XtraTreeList MainDemo

Example

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

csharp
List<TreeListNode> list = treeList1.GetAllCheckedNodes();
foreach (TreeListNode node in list) {
    decimal budget = Convert.ToDecimal(node["BUDGET"])*1.1m;
    node["BUDGET"] = budget;
}
vb
Dim list As List(Of TreeListNode) = treeList1.GetAllCheckedNodes()
For Each node As TreeListNode In list
    Dim budget As Decimal = Convert.ToDecimal(node("BUDGET")) * 1.1D
    node("BUDGET") = budget
Next

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CheckBoxStyle property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-dashboard-custom-items-extension/CS/CustomItemExtension/CustomItems/TreeList/TreeListItemControlProvider.cs#L69

csharp
if(tree.OptionsView.CheckBoxStyle == DefaultNodeCheckBoxStyle.Radio) {
    skipMasterFiltering = true;

winforms-dashboard-custom-items-extension/VB/CustomItemExtension/CustomItems/TreeList/TreeListItemControlProvider.vb#L77

vb
If tree.OptionsView.CheckBoxStyle = DefaultNodeCheckBoxStyle.Radio Then
    skipMasterFiltering = True

See Also

RootCheckBoxStyle

ChildrenCheckBoxStyle

TreeListOptionsView Class

TreeListOptionsView Members

DevExpress.XtraTreeList Namespace