Back to Devexpress

TreeListMappings.KeyFieldName Property

windowsforms-devexpress-dot-xtragantt-dot-treelistmappings.md

latest2.8 KB
Original Source

TreeListMappings.KeyFieldName Property

Gets or sets the name of the key field that uniquely identifies records in the data source.

Namespace : DevExpress.XtraGantt

Assembly : DevExpress.XtraGantt.v25.2.dll

NuGet Package : DevExpress.Win.Gantt

Declaration

csharp
[DefaultValue("ID")]
[XtraSerializableProperty]
public string KeyFieldName { get; set; }
vb
<DefaultValue("ID")>
<XtraSerializableProperty>
Public Property KeyFieldName As String

Property Value

TypeDefaultDescription
String"ID"

The key identifier field name.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the KeyFieldName 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/GanttItem/GanttItemControlProvider.cs#L97

csharp
gantt.Columns.Clear();
gantt.TreeListMappings.KeyFieldName = gantt.TreeListMappings.ParentFieldName = gantt.ChartMappings.TextFieldName
    = gantt.ChartMappings.StartDateFieldName = gantt.ChartMappings.FinishDateFieldName = string.Empty;

winforms-dashboard-custom-items-extension/VB/CustomItemExtension/CustomItems/GanttItem/GanttItemControlProvider.vb#L96

vb
gantt.TreeListMappings.ParentFieldName = gantt.ChartMappings.TextFieldName
gantt.TreeListMappings.KeyFieldName = gantt.TreeListMappings.ParentFieldName
If Not ValidateBindings() Then

See Also

TreeListMappings Class

TreeListMappings Members

DevExpress.XtraGantt Namespace