我是一名.NET新手,目前正在加入现有的鳕鱼。我有一个telerik RadGrid - 它从.NET的标准GridView控件继承事件。
这是aspx文件中的标记:
<telerik:RadGrid runat="server" ID="GridViewSelector" SkinID="GridViewSelectorSkin" AllowPaging="True" PageSize="12" AllowSorting="True" EnableViewState="true"
AllowCustomPaging="true" AllowFilteringByColumn="true" DataKeyNames="ID" AutoGenerateColumns="false" ShowFooter="false" style="float:left;"
AllowMultiRowEdit="false" OnNeedDataSource="GridViewSelector_NeedDataSource"
OnItemCommand="GridViewSelector_ItemCommand" EnableEmbeddedSkins="false" OnItemCreated="GridViewSelector_ItemCreated"
OnSortCommand="GridViewSelector_SortCommand"
OnItemDataBound="GridViewSelector_ItemDataBound"
OnPreRender="GridViewSelector_PreRender">
</telerik:RadGrid>
如何指定一个事件处理程序方法来监听何时选择了一行?
答案 0 :(得分:0)
我想是这样的。
protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)
{
GridDataItem item =(GridDataItem )RadGrid1.SelectedItems[0];//get selected row
}