Click here to Skip to main content
15,896,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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...
Posted
Comments
Herman<T>.Instance 14-Feb-12 5:24am    
is this homework?
codzvellop 14-Feb-12 9:51am    
yes....@digimanus
manognya kota 14-Feb-12 11:57am    
Then sorry to say code would not be given.Only guidance.. :)

1 solution

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.
 
Share this answer
 
v2
Comments
codzvellop 14-Feb-12 5:25am    
@manognya kota..
how can i do this for different users.....all users have same page...how can i show different data in grid when they are loged in at a time on different places...can u help me with coding part plzzz
manognya kota 14-Feb-12 5:59am    
If you have a single page and the application has different sessions ..iam sorry you have to take a different approach.Probably, if you are getting the job list for the admin from a table, you can have another column like assigned_to.Please refer my updated solution.
CRDave1988 14-Feb-12 5:27am    
Same answer.
save user type is session and write if else on each page.
codzvellop 14-Feb-12 5:29am    
@CRdave i have only single page
zyck 14-Feb-12 5:35am    
Hi manognya
do you have sample code?
can you post it?

thanks nice solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900