开发者

Pass the data's from one Gridview to another Gridview :

How to pass the data's from o开发者_如何学JAVAne Gridview to another Gridview in asp.net using C# codings?


Copy data from DataTable that is bound to GridView1 to DataTable that is bound to GridView2.

foreach (DataRow row in dataTable1.Rows)
{
    dataTable2.Rows.Add(row.ItemArray);
}


Ultimately each GridView has some kind of datasource, the gridview is really just presenting the data.

For instance

GridView1.DataSource = foo;
GridView2.DataSource = foo2;

If your goal is to move data you need to work with foo and foo2, the grid view is really not important unless there is some client side interaction that needs to be first persisted before the second gridview gets the data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜