System.Web.UI.WebControls Namespace DataGrid Class
Sets or retrieves a value specifying whether the header is displayed in the DataGrid control.
Inline |
<asp:datagrid showheader = true | false ... > |
Script |
DataGrid.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 DataGrid. 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 DataGrid 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 footer" : "Show footer";
}
Sub ShowHide ( src As Object, E As EventArgs )
myGrid.ShowHeader = Iif ( myGrid.ShowHeader, False, True )
myButton.Text = Iif ( myGrid.ShowHeader, "Hide footer", "Show footer" )
End Sub |
|
C# |
VB |
Show me
DataGrid Members HeaderStyle