2

I have a grid with footer template. It consists of a text box in which i will add some value and after clicking btnAdd the value present in the footer template will append to the main grid. Below is my footer template. I want to make the footer template visible only on clicking btnAdd. How to make it visible and invisible on some button click. Note: button located outside grid.

<FooterTemplate>
                        <asp:TextBox ID="txtFactor" Style="margin-left: 210px" Visible='<%# IsInEditMode %>' runat="server"  >
                        </asp:TextBox> 
premg
  • 21
  • 1
  • 2

3 Answers3

2

You need to rebind your datasource after setting the ShowFooter = true.

Adam
  • 497
  • 2
  • 9
  • 29
1

You could set GridView.ShowFooter = IsInEditMode from codebehind on button-click.

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.showfooter.aspx

Tim Schmelter
  • 450,073
  • 74
  • 686
  • 939
0

use this

GridView1.ShowFooter = false; 
SMK
  • 2,098
  • 2
  • 13
  • 21