Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
i want to populate and show the grid view on aspx page only after button click.
plz help .
Posted 21-Jan-13 19:32pm
Comments
Nandakishorerao at 22-Jan-13 2:40am
   
what have you done till now? ..paste it
rizwan muhammed khan gouri at 22-Jan-13 8:44am
   
what you want?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

while loading time put the visibility of gridview to false and while button click,enable it.
  Permalink  
Comments
heart rocker at 22-Jan-13 2:02am
   
how exactly can i do that
josh-jw at 22-Jan-13 2:07am
   
in page_load event write
Gridview1.visible = false;
in button clcik event
Gridview1.visible = true;
heart rocker at 22-Jan-13 3:26am
   
thnx a lot
josh-jw at 22-Jan-13 3:31am
   
welcome.if you feel this solution helps you,please mark it as answer.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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;
  Permalink  
v2
Comments
heart rocker at 22-Jan-13 2:02am
   
How exactly Can I do that??
Ankit Mishra at 28-Oct-13 10:17am
   
http://www.codeproject.com/Questions/675193/On-button-Click-GridView-is-not-Displaying-Data
shabari7 at 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)

  Print Answers RSS
0 OriginalGriff 6,649
1 Sergey Alexandrovich Kryukov 6,280
2 CPallini 5,230
3 George Jonsson 3,574
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web02 | 2.8.140921.1 | Last Updated 22 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100