Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
can we add a button in asp.net gridveiw control but on page load this gird view is empty when user click on that button it will show all data.



but button is in grid view it is nessary
Posted
Comments
priyadarshini tv 7-May-15 6:06am    
pls refer this

http://stackoverflow.com/questions/1417471/how-to-put-a-button-in-a-header-of-asp-net-gridview

and u can bind the grid data on button click event
Sinisa Hajnal 7-May-15 6:18am    
Or you could use asp:Repeater and add whatever you want.

1 solution

Refer - Dynamically adding and deleting rows from ASP.NET GridView[^].

Here the author has added the Button "Add New Row" on Footer using FooterTemplate inside a TemplateField. As you want to place this at the Header, so move this code inside the HeaderTemplate of one TemplateField.
 
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