Calendar.ShowDayHeader Property
Gets or sets a value indicating whether the heading for the days of the week is displayed.
[Visual Basic] Public Property ShowDayHeader As Boolean [C#] public bool ShowDayHeader {get; set;} [C++] public: __property bool get_ShowDayHeader(); public: __property void set_ShowDayHeader(bool); [JScript] public function get ShowDayHeader() : Boolean; public function set ShowDayHeader(Boolean);
Property Value
true if the heading for the days of the week is displayed; otherwise, false. The default is true.
Remarks
Use the ShowDayHeader property to specify whether the heading for the days of the week is displayed.
The appearance of the heading can be customized by using the DayHeaderStyle property.
Example
[Visual Basic, C#, JScript] The following example demonstrates how to use the ShowDayHeader property to hide the heading for the days of the week.
[Visual Basic] <%@ Page Language="VB" AutoEventWireup="True" %> <html> <head> </head> <body> <form runat="server"> <h3>Calendar Example</h3> <asp:Calendar id="calendar1" runat="server" ShowDayHeader="False"/> </form> </body> </html> [C#] <%@ Page Language="C#" AutoEventWireup="True" %> <html> <head> </head> <body> <form runat="server"> <h3>Calendar Example</h3> <asp:Calendar id="calendar1" runat="server" ShowDayHeader="False"/> </form> </body> </html> [JScript] <%@ Page Language="JScript" AutoEventWireup="True" %> <html> <head> </head> <body> <form runat="server"> <h3>Calendar Example</h3> <asp:Calendar id="calendar1" runat="server" ShowDayHeader="False"/> </form> </body> </html> [Visual Basic] <%@ Page Language="VB" AutoEventWireup="True" %> <html> <script runat="server" > Sub Check_Change(sender As Object, e As EventArgs) ' Show or hide the day header section of the Calendar control ' depending on the state of the ShowDayHeaderCheckBox CheckBox ' control. If ShowDayHeaderCheckBox.Checked Then Calendar1.ShowDayHeader = True Else Calendar1.ShowDayHeader = False End If End Sub </script> <body> <form runat="server"> <h3> Calendar ShowDayHeader Example </h3> Select whether to show or hide the day header section. <br><br> <asp:Calendar id="Calendar1" ShowTitle="True" runat="server"/> <br><br> <asp:CheckBox id="ShowDayHeaderCheckBox" Text="Show/Hide day header section" AutoPostBack="True" Checked="True" OnCheckedChanged="Check_Change" runat="server"/> </form> </body> </html> [C#] <%@ Page Language="C#" AutoEventWireup="True" %> <html> <script runat="server" > void Check_Change(Object sender, EventArgs e) { // Show or hide the day header section of the Calendar control // depending on the state of the ShowDayHeaderCheckBox CheckBox // control. if (ShowDayHeaderCheckBox.Checked) { Calendar1.ShowDayHeader = true; } else { Calendar1.ShowDayHeader = false; } } </script> <body> <form runat="server"> <h3> Calendar ShowDayHeader Example </h3> Select whether to show or hide the day header section. <br><br> <asp:Calendar id="Calendar1" ShowTitle="True" runat="server"/> <br><br> <asp:CheckBox id="ShowDayHeaderCheckBox" Text="Show/Hide day header section" AutoPostBack="True" Checked="True" OnCheckedChanged="Check_Change" runat="server"/> </form> </body> </html>
[C++] No example is available for C++. To view a Visual Basic, C#, or JScript example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family
See Also
Calendar Class | Calendar Members | System.Web.UI.WebControls Namespace | DayHeaderStyle