Back to Devexpress

Obtaining and Setting Cell Values

windowsforms-191-controls-and-libraries-tree-list-feature-center-data-editing-obtaining-and-setting-cell-values.md

latest2.9 KB
Original Source

Obtaining and Setting Cell Values

  • Oct 29, 2020
  • 3 minutes to read

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.

API

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

MemberDescription
TreeList.SetRowCellValueSets the TreeList cell to a specific value.
TreeListNode.ItemGets or sets the edit value of a specific cell.
TreeListNode.GetValueReturns the edit value of a specific cell.
TreeListNode.GetDisplayTextReturns the display value of a specific cell. Display values are text representations of edit values, formatted in a specific manner.
TreeListNode.SetValueChanges 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.

Column Identifiers

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

Task-Based Help

Member Tables