Skip to main content
Tab

CalendarProperties.ShowWeekNumbers Property

Gets or sets a value that specifies whether the week number section is displayed within the calendar.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue(true)]
public bool ShowWeekNumbers { get; set; }

Property Value

Type Default Description
Boolean true

true, if the week number section is visible, otherwise, false.

Remarks

Use the ShowWeekNumbers property to specify whether week number markers are displayed within the calendar. The appearance of week numbers can be customized by using the ASPxCalendar.WeekNumberStyle property.

Note that the calendar’s week numbers are represented as ISO week numbers. According to the ISO (International Standards Organization) in document ISO 8601, an ISO week starts on a Monday (which is counted as day 1 of the week), and week 1 for a given year is the week that contains the first Thursday of the Gregorian year. Week numbers in ISO 8601 are integers from 1 to 52 or 53; parts of week 1 may be in the previous calendar year; parts of week 52 may be in the following calendar year; and if a year has a week 53, parts of it must be in the following calendar year.

Note

The ShowWeekNumbers property synchronizes its value with the editor’s ASPxCalendar.ShowWeekNumbers property.

Example

This section of the Custom Day Rendering online demo illustrates how to customize the ASPxCalendar settings.

...
<dxe:ASPxCalendar ID="clndWeatherForecast" runat="server" 
             OnDayRender="OnCalendarDayRender" ShowClearButton="False" 
             ShowTodayButton="False" ShowWeekNumbers="False" Font-Size="8pt" 
             Font-Names="Trebuchet MS" ForeColor="#07519A" 
             ClientInstanceName="Calendar" SkinID="None" 
             EnableViewState="False" BackColor="White">
             <ButtonStyle BackColor="#EBF3FB" Width="80px" Cursor="pointer">
                 <HoverStyle BackColor="#E2ECF8" />
                 <PressedStyle BackColor="#C4DCF4" />
                 <Border BorderWidth="1px" BorderStyle="Solid" BorderColor="#AACCEE" />
             </ButtonStyle>
             <PrevMonthImage Height="17px" Width="19px" AlternateText="Previous month" 
             Url="Images/CustomDayRendering/Elements/leftSingleArrow.png" />
             <NextMonthImage Height="17px" Width="19px" AlternateText="Next  month" 
             Url="Images/CustomDayRendering/Elements/rightSingleArrow.png" />
             <BorderRight BorderStyle="None" />
             <DayHeaderStyle Font-Size="12pt">
              <BorderBottom BorderWidth="1px" BorderStyle="Solid" BorderColor="#AACCEE" />
              <BorderRight BorderWidth="1px" BorderStyle="Solid" BorderColor="#AACCEE" />
             </DayHeaderStyle>
             <MonthGridPaddings Padding="0px" />
             <Border BorderStyle="Solid" BorderColor="#AACCEE" BorderWidth="1px" />
             <NextYearImage Height="17px" Width="19px" AlternateText="Next year" 
             Url="Images/CustomDayRendering/Elements/rightDoubleArrow.png" />
             <HeaderStyle Spacing="5px" HorizontalAlign="Center" Font-Size="16pt" 
             BackColor="#EBF3FB" ForeColor="#51A8DF">
                 <Paddings PaddingTop="3px" PaddingRight="5px" PaddingBottom="3px" 
                 PaddingLeft="5px" />
                 <BackgroundImage Repeat="RepeatX" VerticalPosition="bottom" 
                 ImageUrl="Images/CustomDayRendering/Elements/headerBg.png" />
                 <Border BorderWidth="1px" BorderStyle="Solid" BorderColor="#AACCEE" />
                 <BorderTop BorderStyle="None" />
                 <BorderLeft BorderStyle="None" />
             </HeaderStyle>
             <FastNavFooterStyle Spacing="5px" HorizontalAlign="Center" BackColor="#EBF3FB">
                 <Paddings Padding="10px" />
                 <Border BorderWidth="1px" BorderStyle="Solid" BorderColor="#AACCEE" />
                 <BorderTop BorderStyle="None" />
             </FastNavFooterStyle>
             <FastNavMonthStyle Font-Italic="False" Cursor="pointer">
                 <Paddings PaddingTop="5px" PaddingRight="2px" PaddingBottom="5px" 
                 PaddingLeft="2px" />
                 <HoverStyle BackColor="#E2ECF8">
                     <Border BorderWidth="1px" BorderStyle="Solid" BorderColor="#AACCEE" />
                 </HoverStyle>
                 <SelectedStyle BackColor="#C4DCF4" />
             </FastNavMonthStyle>
             <DayOtherMonthStyle ForeColor="#C9DEF4">
             <BackgroundImage ImageUrl="Images/CustomDayRendering/Elements/otherMonthDayBg.png" />
             </DayOtherMonthStyle>
             <PrevYearImage Height="17px" Width="19px" AlternateText="Previous year" 
             Url="Images/CustomDayRendering/Elements/leftDoubleArrow.png" />
             <DayStyle VerticalAlign="Top" Cursor="default">
                 <Paddings Padding="3px" />
                 <Border BorderWidth="1px" BorderStyle="Solid" BorderColor="#AACCEE" />
                 <BorderTop BorderStyle="None" />
                 <BorderLeft BorderStyle="None" />
             </DayStyle>
             <FastNavPrevYearImage Height="17px" Width="19px" AlternateText="Previous year" 
             Url="Images/CustomDayRendering/Elements/leftSingleArrow.png" />
             <FastNavYearStyle Cursor="pointer">
                 <Paddings PaddingTop="2px" Padding="4px" />
                 <HoverStyle BackColor="#E2ECF8">
                     <Border BorderWidth="1px" BorderStyle="Solid" BorderColor="#AACCEE" />
                 </HoverStyle>
                 <SelectedStyle BackColor="#C4DCF4" />
             </FastNavYearStyle>
             <BorderBottom BorderStyle="None" />
             <FastNavNextYearImage Height="17px" Width="19px" AlternateText="Next year" 
             Url="Images/CustomDayRendering/Elements/rightSingleArrow.png" />
             <DaySelectedStyle BackColor="#E2ECF8" />
             <FastNavStyle MonthYearSpacing="8px" HorizontalAlign="Center" VerticalAlign="Top" 
              Font-Size="12pt" Font-Bold="False" 
                 BackColor="#EBF3FB" ImageSpacing="12px">
                 <Paddings Padding="10px" />
                 <Border BorderWidth="1px" BorderStyle="Solid" BorderColor="#AACCEE" />
             </FastNavStyle>
         </dxe:ASPxCalendar>
...
See Also