Return to the menu   Select another DES Module

Demonstrates the QuickDateMenu control.

The QuickDateMenu control offers a list of predefined dates. When selected, a DateTextBox or range of two DateTextBoxes are updated with the dates described by the menu command.

Add a QuickDateMenu control and set its DateTextBoxControlID property to the ID of the DateTextBox, or DateTextBoxControl to the reference of that DateTextBox. If the DateTextBox's RangeEndControlID is assigned, the QuickDateMenu knows to update both.

Define PeterBlum.DES.Web.WebControls.QuickDateItem objects in the Items collection. It offers a list of predefined rules in its QuickRange property. If you need another rule, define it in the StartDate and EndDate properties. Set the label of the menu command in the Label property.


Controls

Click on the image to the left of each DateTextBox and select an item.

With one DateTextBox



With two DateTextBoxes setup as a range

Start: End:

Source Code (C#)

Click on the image to the left of each DateTextBox and select an item.<br/><br/>
<h2>With one DateTextBox</h2>
<des:QuickDateMenu ID="QuickDateMenu1" runat="server" DateTextBoxControlID="DateTextBox1"
   ToggleImageUrl="{APPEARANCE}/Date and Time/QuickDate.gif">
   <des:QuickDateItem Label="Today" QuickRange="Today" />
   <des:QuickDateItem QuickRange="Tomorrow" />
   <des:QuickDateItem Label="Yesterday" QuickRange="Yesterday" />
   <des:QuickDateItem QuickRange="ThisWeek" />
   <des:QuickDateItem Label="Last Week" QuickRange="LastWeek" />
   <des:QuickDateItem Label="This Month" QuickRange="ThisMonth" />
   <des:QuickDateItem StartDate-ActualDate="2007-12-25" StartDate-DateType="Actual" 
         EndDate-DateType="Blank" Label="Christmas 2007" />
</des:QuickDateMenu>
<des:DateTextBox ID="DateTextBox1" runat="server" />
<br/>
<br/>
<h2>With two DateTextBoxes setup as a range</h2>
<des:QuickDateMenu ID="QuickDateMenu2" runat="server" DateTextBoxControlID="DateTextBox2"
      SharedGroup="Alt" > <%-- SharedGroup is only used because we have two QuickDateMenus with separate features selected.--%>
   <des:QuickDateItem Label="Today" QuickRange="Today" />
   <des:QuickDateItem QuickRange="Tomorrow" />
   <des:QuickDateItem Label="Yesterday" QuickRange="Yesterday" />
   <des:QuickDateItem QuickRange="ThisWeek" />
   <des:QuickDateItem Label="Last Week" QuickRange="LastWeek" />
   <des:QuickDateItem Label="This Month" QuickRange="ThisMonth" />
   <des:QuickDateItem QuickRange="EarliestToEnd" Label="EarliestToEnd" />
  <des:QuickDateItem></des:QuickDateItem>
  <des:QuickDateItem Label="Month before Christmas" EndDate-PeriodType="Year" EndDate-DayOffset="-7" StartDate-PeriodType="Year" StartDate-DayOffset="-36"></des:QuickDateItem>
</des:QuickDateMenu>
Start:<des:DateTextBox ID="DateTextBox2" runat="server" RangeEndControlID="DateTextBox3" />
End:<des:DateTextBox ID="DateTextBox3" runat="server" />

Return to the menu   Select another DES Module