我創建了一個GridView
,並設置其標題:如何將行刪除按鈕連接到我的GridView_RowDeleted事件?
<asp:GridView ID="ProductsGridView"
DataSourceID="ProductsDataSource"
AllowPaging="True"
AutoGenerateColumns="False"
runat="server" CellPadding="4" ForeColor="#333333" GridLines="None"
AutoGenerateDeleteButton="True"
AutoGenerateEditButton="True"
OnRowCancelingEdit="GridView1_RowCancelingEdit"
OnRowUpdating="GridView1_RowUpdating"
OnRowEditing="GridView1_RowEditing"
OnRowDeleted="ProductsGridView_RowDeleted"
onselectedindexchanged="ProductsGridView_SelectedIndexChanged">
我可以看到在網格中的刪除按鈕,但是當我上雙擊按鈕時,Visual Studio帶我到:
protected void ProductsGridView_SelectedIndexChanged(object sender, EventArgs e)
代替:
protected void ProductsGridView_RowDeleted(object sender, GridViewDeletedEventArgs e).
這個事件沒有對發送行信息。我錯過了什麼?
我想你要走了一些代碼從你上面的例子說的是造成SelectedIndexChanged事件火災前/而不是刪除,然後刪除事件。上面的代碼應該按照規定工作。 –
這是我想了解 - 它一直髮送給我 – aralele