Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to transfer product from gridview1 to gridview2 just like an add to car or shopping cart

first i have a gridview1 with data inside (ProductID, ProductName and UnitPrice) and I add a add button inside the gridview.

i want to redirect that file to another Form with another gridview.

Problems:

1. i don't know how put the code in the add button inside the gridview
2. And what code to put to redirect that info to another gridview
Posted
Updated 28-Jul-11 3:20am
v2
Comments
_Zorro_ 28-Jul-11 5:41am    
Coul you tell us more? What exactly are you trying to do?
When do you want to copy? what? where?

Do you just want to move a selected item to another GridView? Or do you want to duplicate the whole GridView?

We need more information, you guys could do an effort when submitting questions...

protected void CopyDataSource()
{
    gridview2.DataSource = gridview1.DataSource;
    gridview2.DataBind();
}
 
Share this answer
 
Comments
_Zorro_ 28-Jul-11 5:39am    
I don't think that's what he's looking for.
DominicZA 28-Jul-11 5:44am    
Lol, yes, but I answered his question. If he wants a better answer, he should word his question better.
_Zorro_ 28-Jul-11 5:45am    
You make a point there
Used This Method to fill Gridview

Gridview1.DataSource=ds;
Gridview2.DataSource=ds;
Gridview1.DataBind();
Gridview2.DataBind();
 
Share this answer
 

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