BootstrapGridViewBuilderBase<T>.KeyFieldName(String) Method
Sets the name of the data source key field.
Namespace: DevExpress.AspNetCore.Bootstrap
Assembly: DevExpress.AspNetCore.Bootstrap.v18.2.dll
#Declaration
#Parameters
Name | Type | Description |
---|---|---|
key |
String | A string value that specifies the name of the data source key field. |
#Returns
Type | Description |
---|---|
T | A reference to this instance after the operation is completed. |
#Remarks
IMPORTANT
Bootstrap Controls for ASP.
Some operations (e.g., editing and grouping) require a key field to be specified. Use the KeyFieldName method for this purpose.
@model IEnumerable<Email>
@(Html.DevExpress()
.BootstrapGridView("grid")
.KeyFieldName("ID")
.Columns(columns => {
columns.Add("From");
...
})
.Routes(routes => routes
.MapRoute(r => r.Action("Binding").Controller("GridView")))
.Bind(Model)