aspnetmvc-devexpress-dot-web-dot-mvc-dot-treelistsettings-5ff21ae2.md
Gets or sets the name of the data source key field.
Namespace : DevExpress.Web.Mvc
Assembly : DevExpress.Web.Mvc5.v25.2.dll
NuGet Package : DevExpress.Web.Mvc5
public string KeyFieldName { get; set; }
Public Property KeyFieldName As String
| Type | Description |
|---|---|
| String |
A String value that specifies the name of the data source key field.
|
Since TreeList is designed to display information in a tree structure, its data source should meet certain requirements. If a data source contains flat data, two additional fields are necessary to build a tree structure.
Note
The data types of the KeyField and ParentField fields must be the same.
Important
When TreeList is bound to a hierarchical data source (e.g. XmlDataSource), the KeyFieldName and TreeListSettings.ParentFieldName properties are not in effect.
See Also