使用对象数据源将一行网格视图复制到另一个网格视图 [英] Copy a row of Grid View to another Grid View using Object Data Source

查看:71
本文介绍了使用对象数据源将一行网格视图复制到另一个网格视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用对象数据源将一行网格视图复制到另一个网格视图

单击选择



选择并单击按钮

和复制选择一两个



Copy a row of Grid View to another Grid View using Object Data Source
click select
or
select and clicked a button
and copy selected one or two

demo/sample please
i am amateur

推荐答案

使用GridView中的列全局创建一个DataTable对象..



之后选择一行,然后点击按钮,



按钮单击,



1)通过GridView迭代行。

2)获取复选框控件ID并查看是否已选中。

3)如果选中,则创建DataRow对象,并将GridViewRow值传递给DataRow并添加它到DataTable。

4)最后,将DataTable添加到第二个GridView。
create a DataTable object globally with columns like in GridView..

After selecting a row, and in button click,

Button Click,

1) Iterate through the GridView Rows.
2) Get checkbox control id and see whether it is checked or not.
3) If checked, create DataRow object, and pass GridViewRow values to DataRow and add it to DataTable.
4) Finally, Add the DataTable to the second GridView.


这篇关于使用对象数据源将一行网格视图复制到另一个网格视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆