In which cases should I use a GridView's property DataKeyNames
?
在哪些情况下我应该使用GridView的属性DataKeyNames?
Why are multiple columns/fields allowed here?
为什么这里允许多列/字段?
2 个解决方案
#1
8
Gets or sets an array that contains the names of the primary key fields for the items displayed in a GridView control.
获取或设置一个数组,其中包含GridView控件中显示的项的主键字段的名称。
GridView.DataKeyNames Property
GridView.DataKeyNames属性
GridView.DataKeys属性
#2
3
It keeps the primary key
fields or id
field of data table, which gridview shows.
According to MSDN
它保留数据表的主键字段或id字段,gridview显示。根据MSDN
Gets or sets an array that contains the names of the primary key fields for the items displayed in a GridView control.
获取或设置一个数组,其中包含GridView控件中显示的项的主键字段的名称。
#1
8
Gets or sets an array that contains the names of the primary key fields for the items displayed in a GridView control.
获取或设置一个数组,其中包含GridView控件中显示的项的主键字段的名称。
GridView.DataKeyNames Property
GridView.DataKeyNames属性
GridView.DataKeys属性
#2
3
It keeps the primary key
fields or id
field of data table, which gridview shows.
According to MSDN
它保留数据表的主键字段或id字段,gridview显示。根据MSDN
Gets or sets an array that contains the names of the primary key fields for the items displayed in a GridView control.
获取或设置一个数组,其中包含GridView控件中显示的项的主键字段的名称。