ComponentOne Extender Controls for ASP.NET Web Forms
Wijmo Control Toolkit Extender Controls / Input Extenders / C1InputDateExtender / Creating a Drop-Down List of Dates
In This Topic
    Creating a Drop-Down List of Dates
    In This Topic

    The C1InputDateExtender control allows you to create a drop-down list box of dates. Use the showTrigger option to show the drop-down arrow and use the comboItems option to populate the drop-down list.

    1.       Create an ASP.NET Web application.

    2.       Add a standard TextBox control to the main content of  your page.

    3.       Click the TextBox smart tag and select Add Extender from the Tasks menu.

    4.       In the Extender Wizard, select C1InputDateExtender and click OK. A C1InputDateExtender control is added to the page and the TargetControlID is set to TextBox1.

    5.       Select View | Properties Window in the Visual Studio menu.

    6.       Click the drop-down list at the top of the Properties window and select TextBox1_C1InputDateExtender.

    ·         Set the C1InputDateExtender.DateFormat property to yyyy/M/d.

    ·         Set the C1InputExtenderBase.ShowTrigger property to True.

    ·         Click the ellipsis button next to the C1InputExtenderBase.ComboItems property. Add three members.

    Member

    Label Property

    Value Property

    0

    Birthday

    4/8/1980

    1

    Wedding Day

    12/25/2007

    3

    Today

    1/3/2012

    The markup should now look similar to the following:

    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

            <cc1:C1InputDateExtender ID="TextBox1_C1InputDateExtender" runat="server"

                DateFormat="yyyy/M/d" ShowTrigger="True" TargetControlID="TextBox1">

                <PopupPosition>

                    <Offset Top="4">

                    </Offset>

                </PopupPosition>

                <ComboItems>

                    <cc1:C1ComboBoxItem Label="Birthday" Value="4/8/1980" />

                    <cc1:C1ComboBoxItem Label="Wedding Day" Value="12/25/2007" />

                    <cc1:C1ComboBoxItem Label="Today" Value="1/3/2012" />

                </ComboItems>

            </cc1:C1InputDateExtender>

    7.       Press F5 to run the application. The showTrigger option displays the drop-down arrow. The dateFormat option sets the format of the dates, and the drop-down list specified in the comboItems option contains three list items. When you click one of the list items, the date (value) appears in the text box.