copying rows from one gridview to another gridvies
hi,
am filling one gridview with values from database..then i want to copy the selected rows through checkboxes into another gridview..
below is the code in c#
DataTable dt = new DataTable();
foreach(GridViewRow dgr in GridView1.Rows)
{
if(((CheckBox)(dgr.FindControl("chkbx"))).Checked==true)
{
dt.Rows.Add(dgr);
}
GridView2.DataSource=dt;
GridView2.DataBind();
when i compile am getting Input array is longer than the number of columns in this table error message..am new to .net..any help will be greatly appreciated..