Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[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]Pivot Grid
  [Collapse]Tree List
   [Expand]Product Information
   [Collapse]Feature Center
    [Expand]Data Binding
    [Expand]Nodes
    [Collapse]Data Editing
      Inplace Editors
      Obtaining and Setting Cell Values
      Assigning Editors to Columns
      Assigning Editors to Individual Cells
      Showing and Hiding Editors
    [Expand]Data Representation
    [Expand]Sorting
    [Expand]Filtering
    [Expand]Summaries
    [Expand]Appearances and Look And Feel
    [Expand]Focus, Selection and Navigation
     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]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]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Obtaining and Setting Cell Values

The Tree List control displays data by means of nodes that contain cells for each column. Each cell's data can be obtained and changed. See below, for information on how to get and set cell values.

 

Expanded API

To get and set cell values in code, use the methods provided by the TreeListNode class:

TreeListNode member Description
TreeListNode.Item Gets or sets the edit value of a specific cell.
TreeListNode.GetValue Returns the edit value of a specific cell.
TreeListNode.GetDisplayText Returns the display value of a specific cell. Display values are text representations of edit values, formatted in a specific manner.
TreeListNode.SetValue Changes the edit value of a specific cell.

There are multiple ways to obtain a node object before getting/changing its cells. Please refer to Member Table: Nodes, to find out which common methods can be used to obtain references to nodes.

The methods listed in the table above require a column identifier as a parameter. The following section describes column identifiers supported by the methods.

Expanded Column Identifiers

Several objects can be used as column identifiers. These are:

  • The TreeListColumn object representing the desired column.

    The following code may be used to obtain a TreeListColumn object by its field name. We will assume that there is a column bound to the "Budget" field. The TreeList.Columns property of the Tree List control is used to access the column.

  • The TreeListColumn.FieldName property value of the desired column.

    The field name is a string that binds the column to a data source field. When a Tree List is populated from the System.Data.DataTable object, for example, the TreeListColumn.FieldName is automatically initialized with the name of a field from the data source.

  • The TreeListColumn.AbsoluteIndex property value of the desired column.

    The absolute index is the position of the column within the column collection. The following code demonstrates how to get this value for the "Budget" column.

  • The System.Data.DataColumn object corresponding to the desired column (if the TreeList.DataSource is represented by a System.Data.DataView or System.Data.DataTable source).

Expanded Task-Based Help

Expanded Member Tables

How would you rate this topic?​​​​​​​