System.Web.UI.WebControls Namespace GridView Class
.NET Framework version 2.0
Sets or retrieves a value specifying whether the header is displayed in the GridView control.
Inline |
<asp:gridview showheader = true | false ... > |
Script |
GridView.ShowHeader [ = true | false ] |
This property accepts or returns only a boolean value: true to display the header; otherwise, false. Default value is true.
Set this property to true to display the header in the GridView. The appearance of the header is controlled by using the HeaderStyle property.
The following example demonstrates how to programmatically set the ShowHeader property to hide or show the header on the GridView control at run time, depending on user input.
void ShowHide ( Object src, EventArgs E ) {
myGrid.ShowHeader = myGrid.ShowHeader ? false : true;
myButton.Text = myGrid.ShowHeader ? "Hide header" : "Show header";
}
Sub ShowHide ( src As Object, E As EventArgs )
myGrid.ShowHeader = Iif ( myGrid.ShowHeader, False, True )
myButton.Text = Iif ( myGrid.ShowHeader, "Hide header", "Show header" )
End Sub |
|
C# |
VB |
Show me
GridView Members HeaderStyle ShowFooter