Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
i want to populate and show the grid view on aspx page only after button click.
plz help .
Posted
Comments
Nandakishore G N 22-Jan-13 2:40am    
what have you done till now? ..paste it
rizwan muhammed khan gouri 22-Jan-13 8:44am    
what you want?

while loading time put the visibility of gridview to false and while button click,enable it.
 
Share this answer
 
Comments
heart rocker 22-Jan-13 2:02am    
how exactly can i do that
josh-jw 22-Jan-13 2:07am    
in page_load event write
Gridview1.visible = false;
in button clcik event
Gridview1.visible = true;
heart rocker 22-Jan-13 3:26am    
thnx a lot
josh-jw 22-Jan-13 3:31am    
welcome.if you feel this solution helps you,please mark it as answer.
At the Page_Load event invisible the gridview and at the Button_Click event populate the data and visible the gridview.

Lets say the page name where you want to show the GridView is ShowData.aspx
Then in the Page_Load event of ShowData.aspx page invisible the gridview as

YourGridViewName.visible=false;

Then in the Button_Click event Retrive the data for GridView and make visible property "true" as

YourGridViewName.DataSource=YourDataSource;
YourGridViewName.visible=true;
 
Share this answer
 
v2
Comments
heart rocker 22-Jan-13 2:02am    
How exactly Can I do that??
Ankit Mishra 28-Oct-13 10:17am    
http://www.codeproject.com/Questions/675193/On-button-Click-GridView-is-not-Displaying-Data
[no name] 22-Jan-13 2:18am    
don't include the gridview method in page load, just do in button click

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