Click here to Skip to main content
15,911,132 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I've been wondering is there anyway to pass a grid from Page 1 to Page 2 in the same solution?

Hope to hear from you soon.

Thanks in advance.
Posted

Hi Alif,

You can store grid in session and access on another page.

Page1:

Session["grv"] = "YourGridViewID"

Page 2:

GridView gv = (GridView)Session["grv"]

Thanks,
Bhagyesh
 
Share this answer
 
Comments
Raman Midha 24-Apr-14 3:12am    
Hi Bhagyesh this in not asp.net where we can use session variable ... its windows application sir ..
Bh@gyesh 24-Apr-14 4:23am    
Create gridview property in page2. see below :
Page1 :
//Calling page2
this.Hide();
frmpage2 pg2 = new frmpage2(objgridview);
pg2.Show();

Page 2:
public gridview objgridview
{
get { return objgridview }
set { objgridview = value; }
}
This code is for your reference. It may contain some syntax error.
you can create grid property in form2 and can set from page 1 ... and then u can access the page 1 grid in page 2
 
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