Calendar demo

Source of: ResMonth.aspx
<script runat="server">

    protected override void OnLoad(EventArgs e) {
        base.OnLoad(e);
        Sch.TimeResolution = (TimeResolutions)Enum.Parse(
            typeof(TimeResolutions), ResolutionButtonList.SelectedValue);

        int ncols;
        if (int.TryParse(NumerOfColsEdit.Text, out ncols)) {
            if (ncols<1) ncols = 1;
            if (ncols>1000) ncols = 1000;
        }
        else
            ncols = 48;
        Sch.NumberOfCols = ncols;
        NumerOfColsEdit.Text = ncols.ToString();

        Sch.CellWidth = WiderCheck.Checked ? Unit.Pixel(30) : Unit.Pixel(15);
    }

    protected void Page_Load(object sender, EventArgs e) {

    }
</script>

    <table>
        <tr>
            <td valign="top" style="width:100%">
                <gos:Scheduler ID="Sch" runat="server" Width="100%" Height="317px" Caption="Scheduler's time resolutions"
                    LinkLine="1px Black Solid" BehaviorOptions="AllowOverlapItems, Default" BackColor="WhiteSmoke"
                    EnableViewState="False" Font-Names="Verdana" Font-Size="Small" ForeColor="Navy"
                    FreeDateColor="LightCoral" FreeTimeColor="Khaki" HorizontalHeaderLine="1px Black Solid"
                    HorizontalLine="1px Silver Solid" NumberOfCols="48"
                    VerticalLine0="2px Silver Solid" VerticalLine1="1px Silver Solid"
                    VerticalResourceLine="1px Silver Solid">
                    <CaptionStyle HorizontalAlign="Center"
                        ResourceImage="Blue">
                    </CaptionStyle>
                    <BodyStyle BackColor="LemonChiffon">
                    </BodyStyle>
                    <ResourceListStyle BackColor="Snow">
                    </ResourceListStyle>
                    <ResourceHeaderStyle BackColor="213, 225, 255">
                    </ResourceHeaderStyle>
                    <TimeLineStyle Font-Size="X-Small" ResourceImage="Gray">
                    </TimeLineStyle>
                </gos:Scheduler>
            </td>
            <td valign="top">
            <div style="width: 250px">
                Choose one of the available resolutions.<br />
                Scheduler.TimeResolution:
                <asp:RadioButtonList ID="ResolutionButtonList" runat="server" AutoPostBack="True">
                    <asp:ListItem>OneDay</asp:ListItem>
                    <asp:ListItem Selected="True">Week</asp:ListItem>
                    <asp:ListItem>Month</asp:ListItem>
                    <asp:ListItem>Quarter</asp:ListItem>
                    <asp:ListItem>Year</asp:ListItem>
                </asp:RadioButtonList><a href="ResDay.aspx">more hourly and minutely resolutions</a><br />
                <br />
                Number of columns for a unit of time.<br />
                Scheduler.NumerOfCols:
                <asp:TextBox ID="NumerOfColsEdit" runat="server" AutoPostBack="True" Width="71px">48</asp:TextBox><br />
                <br />
                <asp:CheckBox ID="WiderCheck" runat="server" AutoPostBack="True" Text="Wider time cells" Checked="True" /><br />
               </div> 
            </td>
        </tr>
    </table>
    <br />
    <span style="font-size: 8pt">Time period and resolution of time presented in a scheduler
        depend on values of two properties: <em>Scheduler.TimeResolution</em> and <em>Scheduler.NumberOfCols</em>.
        Multiplying a unit of time and a number of columns determines a period displayed.
        Additionally using a <em>Scheduler.FirstDateTime</em> property an origin and a <em>Scheduler.LastDateTime</em>
        property the end of time axis can be set. Changing a <em>Scheduler.LastDateTime</em>
        property you force recalculation of a <em>Scheduler.NumberOfCols</em> property.
        Buttons going to next and previous period of time change origin of a time axis in
        a scheduler. Displayed time period is not changed. A situation
        when a scheduler shows a whole month is an exception. Then changing to next or previous
        period of time is performed in such a way that the same number of full months are
        displayed. It means that a change of a number of displaying columns is possible.<br />
        Operation of this sample page is very simple. After setting the fields above a scheduler
        are set, a <strong>request</strong> to a server (<strong>postback</strong>) is generated
        and <em>Scheduler</em> object properties initialized with values entered in fields
        using a <em>OnLoad()</em> server method.</span> 

(C) ComponentGo! 2010 | Home | Site map | Partners | Links | Forum | info@componentgo.com