如何将数据从网格导出到另一页上的其他网格? [英] How to export data from grid to other grid on other page?

查看:196
本文介绍了如何将数据从网格导出到另一页上的其他网格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,我必须将页面上的网格数据导出到另一页上的另一个网格..

我的逻辑是我有带有复选框的网格......,我有一个管理员和3个用户...当他们登录时,我有一页用于"admin",另一页用于"3个用户"被带到自己的页面.....当管理员登录时,他的网格充满了带有复选框的数据....



1)现在,管理员"登录并访问他的页面,他的页面如下所示
他有一个名为分配工作"的按钮,以及一个与三个用户名绑定的下拉列表.
2)管理员使用复选框选择一些数据,然后从dop下拉列表中选择用户名,然后单击分配工作"按钮.
3)以同样的方式,他为其他两个用户使用....
4)当用户1登录时,所有用户在同一页面上,他应该只看到admin分配给他的工作,而当用户2登录时,则应显示他的工作.


谁能告诉我如何开始...我应该如何准备数据库并使用它....
并能为我提供所需的代码...将对我有所帮助...

在此先感谢大家...

Hi i have application where i have to export grid data on a page to another grid on other page..

my logic is i have grid with check boxes.........and i have an admin and 3 users...i have one page for "admin" and one page for other "3 users" when they login they are taken to thier own page.....when admin logins he has the grid filled with data with check boxes.......



1)now the "admin" logins and visits his page his page looks like this
he has a button called assign work and a dropdownlist binded with three users names.
2)The admin selects some data using checkbox and selects the username from the dop down list ,and clicks on assign work button.
3)In the same way he does for other two users....
4)Here all the users have same page when user 1 logins he should be seeing only the work assigned to him by admin,when user two logins his work should be shown.


can any 1 tell me how to start this...how should i prepare the database and use that....
and can any provide me the required code...will be helpfull to me...

thanks in advance guys...

推荐答案



这可能不是确切的解决方案.但这对我有用.

1.将网格数据,选中行的数据键保存到会话变量中.
2.在page2中创建一个新的数据表.
3.遍历Datatable1,检查该行是否包含Page1datakeys.
4.如果是,则将该行导入到数据表2.
5.将最终数据表绑定到gridview2.


如果应用程序为用户提供了不同的会话,那么您可以采用其他方法,如

-如果要从表中获取admin的工作列表,则可以有另一列,如assigned_to.当将工作分配给用户并单击按钮时,请在后端的assigned_to列中更新用户名.

-在用户登录名上,选择"assigned_to"列是该用户标识的行,并将其绑定到gridview.


希望这会有所帮助.
Hi,

This might not be the exact solution.But it worked for me.

1.Save your grid data, datakeys of checked rows into a session variables.
2.Create a new datatable in page2.
3.Loop through the Datatable1, check if the row contains the Page1datakeys.
4.If yes,import that row to the datatable2.
5.Bind the final datatable to the gridview2.


If the application has different sessions for the users, then you can follow other approach like,

-If you are getting the job list for the admin from a table, you can have another column like assigned_to.When the job is assigned to the user and button is clicked.update the username in the assigned_to column in the backend.

-On the user login, pick the rows where the assigned_to column is that userid and bind it to the gridview.


Hope this helps.


这篇关于如何将数据从网格导出到另一页上的其他网格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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