Click here to Skip to main content
12,998,892 members (30,255 online)
Rate this:
Please Sign up or sign in to vote.
See more:
i want to populate and show the grid view on aspx page only after button click.
plz help .
Posted 21-Jan-13 19:32pm
Nandakishorerao 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?
Rate this: bad
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.
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.
Rate this: bad
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


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

heart rocker 22-Jan-13 2:02am
How exactly Can I do that??
Ankit Mishra 28-Oct-13 10:17am
shabari7 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170622.1 | Last Updated 22 Jan 2013
Copyright © CodeProject, 1999-2017
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