你的问题有点混乱。您可以使用DeleteCommand获取行的id并将其删除。
<telerik:RadGrid ID="RadGrid1" runat="server"
OnDeleteCommand="RadGrid1_DeleteCommand"
OnNeedDataSource="RadGrid1_NeedDataSource">
<MasterTableView DataKeyNames="Id" CommandItemDisplay="Top">
<Columns>
<telerik:GridButtonColumn ButtonType="ImageButton"
ConfirmText="Are you sure you want to delete?"
CommandName="Delete" ImageUrl="~/Images/Delete.png"
Text="Click to delete" UniqueName="Delete">
</telerik:GridButtonColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
protected void RadGrid1_DeleteCommand(object source, GridCommandEventArgs e)
{
int id = Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["id"]);
// Do delete based on the given id
}
来源
2012-06-04 21:30:34
Win