Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Calendar.SelectorStyle Property

Gets the style properties for the week and month selector column.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
public TableItemStyle SelectorStyle { get; }

Property Value

Type: System.Web.UI.WebControls.TableItemStyle
A TableItemStyle that contains the style properties for the week and month selector column. The default value is an empty TableItemStyle.

Use this property to specify the style for the week and month selector column. For more information on the different style properties that can be controlled, see TableItemStyle.

The SelectorStyle property applies only when the SelectionMode property is set to CalendarSelectionMode.DayWeek or CalendarSelectionMode.DayWeekMonth.

The following code example demonstrates how to use the SelectorStyle property to specify a light gray background color for the selector column.

<%@ Page Language="C#" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Calendar Example</title>
</head>
<body>

   <form id="form1" runat="server">

      <h3>Calendar Example</h3>

      <asp:Calendar id="calendar1" runat="server"
          SelectionMode="DayWeekMonth"
          SelectMonthText="&lt;*&gt;"
          SelectWeekText="-&gt;">

          <SelectorStyle BackColor="LightGray">
          </SelectorStyle>
      </asp:Calendar>

   </form>


</body>
</html>

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1
Show:
© 2015 Microsoft