在asp.net中将行从一个gridview复制到另一个gridview

时间:2013-03-07 04:41:33

标签: javascript asp.net gridview

我有一个包含列的gridview:

FirstName |姓氏|添加

<asp:GridView ID="gv1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
            DataKeyNames="AuthorID" DataSourceID="SqlDataSource1" OnRowCommand="gv1_RowCommand">
            <Columns>
                <asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />
                <asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" />
                <asp:ButtonField ButtonType="Button" Text="Add" />
            </Columns>
        </asp:GridView>

单击“添加”按钮时,将此行复制到第二个gridview,并从orignal gridview隐藏/删除此行。怎么做?