Skip to main content

TreeListColumn.FieldName Property

Gets or sets the field name assigned to the current column from a datasource.

Namespace: DevExpress.XtraTreeList.Columns

Assembly: DevExpress.XtraTreeList.v24.1.dll

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

Declaration

[DefaultValue("")]
[XtraSerializableProperty]
public string FieldName { get; set; }

Property Value

Type Default Description
String String.Empty

A String value that specifies the name of a data field.

Remarks

Use this property to change the field name assigned to the current column from the datasource. If this property is changed at runtime, the column caption is not modified, but the column contents change. In order to update the column caption, set the TreeListColumn.Caption property to the appropriate value.

The FieldName property value can be used as a column identifier, as for example, in the TreeListNode.Item property, TreeListNode.GetValue and other methods.

There must be a case match between strings assigned to the FieldName properties, and the names of the columns in the underlying data source.

Example

The following example demonstrates how to add and adjust a new column bound to the “Checked” field. The column is bound to the field using the TreeListColumn.FieldName property. The sample code changes the caption of the column and its visible index via the TreeListColumn.Caption and TreeListColumn.VisibleIndex properties.

TreeListColumn column = treeList1.Columns.Add();
column.FieldName = "Checked";   
column.Caption = "Check-It";
column.VisibleIndex = treeList1.Columns.Count - 1;

The following code snippets (auto-collected from DevExpress Examples) contain references to the FieldName 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.

See Also