如何在gridview中指定行插入一个button?按下button,隐藏此行后若干行数据急啊

解决方案 »

  1.   


                    <asp:GridView ID="gvTrade" runat="server" AllowPaging="True" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="id" ForeColor="#333333" GridLines="None" Width="100%" EmptyDataText="<div align=center><font color=red>没有您需要的数据</font></div>">
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />                    <Columns>
    <ItemTemplate>
                                    <asp:LinkButton ID="lBtnDel" runat="server" CommandName="Del">删除</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
    </columns>
    </gridview>  Protected Sub gvTrade_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gvTrade.RowCommand Dim tRow As GridViewRow = CType(e.CommandSource, Control).Parent.Parent
                    Dim strDataKey As String = gvTrade.DataKeys(tRow.RowIndex)("id").ToString '取出点击行的主键
    .
    .
    .
    .
    .
    .
    end sub