从 deleterow 方法之外的 gridview 中删除一行
Delete a row from a gridview outside the deleterow method
我想在 RowDeleting 方法之外删除一行。
我正在尝试这样做,但它要求删除发件人和行,但我收到转换错误。
无法将类型 gridview 行转换为 gridview 删除事件参数
这是我的代码,你发现有什么不对吗?
grdContact_RowDeleting((object)grdContact, (GridViewDeleteEventArgs)grdContact.Rows[0]);
protected void grdContact_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
List<DettagliFattura> app = (List<DettagliFattura>)Session["lst_dettagli"];
app.RemoveAt(e.RowIndex);
Session["lst_dettagli"] = app;
FillGrid();
CalcolaTotale();
}
通过使用 tr 和 td 使用如下所示的空模板
<EmptyDataTemplate>
<tr>
<td>
<asp:TextBox runat="server" ID="coursetxt"></asp:TextBox>
</td>
<td>
<asp:Label ID="lbladd3" runat="server"></asp:Label>
<asp:TextBox runat="server" ID="Universitytxt"></asp:TextBox>
</td>
<td>
<asp:TextBox runat="server" ID="sdatetxt"></asp:TextBox>
</td>
<td>
<asp:TextBox runat="server" ID="endtxt"></asp:TextBox>
</td>
<td>
<asp:Button ID="btnInsertRecordedu" runat="server" CssClass="buttonpop" Text="Add" ValidationGroup="edu" CommandName="Insert_emptydatatemplate" /></td>
</tr>
</EmptyDataTemplate>
我想在 RowDeleting 方法之外删除一行。 我正在尝试这样做,但它要求删除发件人和行,但我收到转换错误。
无法将类型 gridview 行转换为 gridview 删除事件参数
这是我的代码,你发现有什么不对吗?
grdContact_RowDeleting((object)grdContact, (GridViewDeleteEventArgs)grdContact.Rows[0]);
protected void grdContact_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
List<DettagliFattura> app = (List<DettagliFattura>)Session["lst_dettagli"];
app.RemoveAt(e.RowIndex);
Session["lst_dettagli"] = app;
FillGrid();
CalcolaTotale();
}
通过使用 tr 和 td 使用如下所示的空模板
<EmptyDataTemplate>
<tr>
<td>
<asp:TextBox runat="server" ID="coursetxt"></asp:TextBox>
</td>
<td>
<asp:Label ID="lbladd3" runat="server"></asp:Label>
<asp:TextBox runat="server" ID="Universitytxt"></asp:TextBox>
</td>
<td>
<asp:TextBox runat="server" ID="sdatetxt"></asp:TextBox>
</td>
<td>
<asp:TextBox runat="server" ID="endtxt"></asp:TextBox>
</td>
<td>
<asp:Button ID="btnInsertRecordedu" runat="server" CssClass="buttonpop" Text="Add" ValidationGroup="edu" CommandName="Insert_emptydatatemplate" /></td>
</tr>
</EmptyDataTemplate>