TreeListNode.SetValue(Object, Object) Method
Sets the value for a specific column.
Namespace: DevExpress.XtraTreeList.Nodes
Assembly: DevExpress.XtraTreeList.v24.1.dll
NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.TreeList
Declaration
Parameters
Name | Type | Description |
---|---|---|
columnID | Object | An object that identifies a column (a TreeListColumn object, field name, column’s absolute index or corresponding DataColumn object). |
val | Object | The value to set for a specific column in the current node. |
Remarks
The following objects and values can be passed as column identifiers:
- TreeListColumn object
- TreeListColumn.FieldName value
- TreeListColumn.AbsoluteIndex value
- System.Data.DataColumn object (when TreeList.DataSource represents the System.Data.DataView or System.Data.DataTable source)
Example
The next example demonstrates how to access a focused node value in the column which is identified by the TreeListColumn.AbsoluteIndex property set to 0.
Two ways are provided to perform this operation: via the TreeListNode.Item property and TreeListNode.SetValue
method.
//first method
treeList1.FocusedNode.SetValue(0, "new value");
//second method
treeList1.FocusedNode[0] = "new value";
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the SetValue(Object, Object) method.
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.