<telerik:RadGrid ID="radGrid" runat="server" AllowPaging="true" AllowCustomPaging="True"
GridLines="None" PageSize="20" AllowMultiRowSelection="true" ClientSettings-Selecting-AllowRowSelect="true"
AutoGenerateColumns="false" onneeddatasource="radGrid_NeedDataSource" OnItemCreated="radGrid_ItemCreated"
OnItemDataBound="radGrid_ItemDataBound" OnItemCommand="radGrid_ItemCommand"
DataKeyNames="ClientID">
<mastertableview datakeynames="ID" gridlines="None" width="100%">
<PagerTemplate> and so on ... </telerik:RadGrid>
场景: -上面给出的是我正在使用的 Telerik RagGrid 控件的标记。我尝试以通常的方式访问 GridColumn 的 KeyValue,
Int32 key = Convert.ToInt32((e.Item as GridDataItem).GetDataKeyValue("ID"));
这是行不通的。有替代品吗?