Calendar demo

Source of: Appearance.aspx
<%@ Import Namespace="ComponentGo.Web" %>

<script runat="server">

    protected override void OnLoad(EventArgs e) {
        base.OnLoad(e);

        Sch.FreeDays = (FreeDays)Enum.Parse(typeof(FreeDays), FreeDaysCombo.SelectedValue);

        Sch.ItemStyle = (SchedulerItemStyle)Enum.Parse(typeof(SchedulerItemStyle), ItemStyleCombo.SelectedValue);

        Sch.LinkLineMode = (LinkLineMode)Enum.Parse(typeof(LinkLineMode), LinkLineCombo.SelectedValue);

        if (HideExpandedRowSumCheck.Checked)
            Sch.ViewOptions |= SchedulerViewOptions.HideExpandedRowSum;
        else
            Sch.ViewOptions &= ~SchedulerViewOptions.HideExpandedRowSum;
    }

    protected void Sch_GetDayInfo(object sender, GetDayInfoEventArgs e) {
        if (e.Date.Day==10 || e.Date.Day==20)
            e.FreeDay = true;
    }
    
</script>

    <table>
        <tr>
            <td valign="top" width="100%">
                <gos:Scheduler ID="Sch" runat="server" Height="439px" Width="100%" Caption="Appearance settings"
                    LinkLine="1px Black Solid" BehaviorOptions="AllowOverlapItems, Default" BackColor="SaddleBrown"
                    EnableViewState="False" Font-Names="Verdana" Font-Size="Small" ForeColor="Navy"
                    FreeDateColor="IndianRed" FreeTimeColor="PaleGoldenrod" HorizontalHeaderLine="1px Firebrick Solid"
                    HorizontalLine="1px Firebrick Solid" 
                    VerticalLine0="2px Firebrick Solid" VerticalLine1="1px Firebrick Solid"
                    VerticalResourceLine="1px Firebrick Solid" CellWidth="20px" SplitterColor="Brown" TimeResolution="OneDay" VerticalLine2="1px Firebrick Dotted" OnGetDayInfo="Sch_GetDayInfo">
                    <CaptionStyle HorizontalAlign="Center" BackColor="Peru" Font-Bold="True" Font-Italic="True" Font-Names="Times New Roman" Font-Size="Medium" ForeColor="SeaShell">
                    </CaptionStyle>
                    <BodyStyle BackColor="LemonChiffon">
                    </BodyStyle>
                    <ResourceListStyle BackColor="BurlyWood" ForeColor="Brown">
                    </ResourceListStyle>
                    <ResourceHeaderStyle BackColor="Peru" Font-Bold="True" Font-Italic="True" Font-Names="Times New Roman" ForeColor="Maroon" HorizontalAlign="Center">
                    </ResourceHeaderStyle>
                    <TimeLineStyle Font-Size="Small" BackColor="SaddleBrown" Font-Bold="True" Font-Names="Times New Roman" ForeColor="Linen">
                    </TimeLineStyle>
                    <DefaultItemStyle BackColor="SandyBrown" Border="1px SaddleBrown Solid" ForeColor="Maroon">
                    </DefaultItemStyle>
                    <NextButton ButtonType="Link">
                        <Style Font-Underline="False" ForeColor="SeaShell" />
                    </NextButton>
                    <PreviousButton ButtonType="Link">
                        <Style Font-Underline="False" ForeColor="SeaShell" />
                    </PreviousButton>
                </gos:Scheduler>
            </td>
            <td valign="top" style="width: 232px">
            <div style="width: 250px">
                <span style="font-size: 8pt">
                By setting the <em>FreeDays</em> property you can control, which days are days off. Additionally,
                you can handle the <em>GetDayInfo</em> event to point at work-free days by the code. Notice,
                every 10th and 20th day of month is free.</span><br />
                FreeDays:
                <asp:DropDownList ID="FreeDaysCombo" runat="server" AutoPostBack="True">
                    <asp:ListItem>None</asp:ListItem>
                    <asp:ListItem>Sunday</asp:ListItem>
                    <asp:ListItem Selected="True">Weekend</asp:ListItem>
                </asp:DropDownList><br />
                <br />
                <span style="font-size: 8pt">
                The item appearance is controlled by the <em>ItemStyle</em> property. Try it, please.</span><br />
                ItemStyle:
                <asp:DropDownList ID="ItemStyleCombo" runat="server" AutoPostBack="True">
                    <asp:ListItem Selected="True">WithText</asp:ListItem>
                    <asp:ListItem>SmallBox</asp:ListItem>
                </asp:DropDownList><br />
                <br />
                <span style="font-size: 8pt">
                The <em>LinkLineMode</em> allows to control rendering lines between scheduler items. You
                can hide, show only line or show line and arrow to.</span><br />
                LinkLineMode:
                <asp:DropDownList ID="LinkLineCombo" runat="server" AutoPostBack="True">
                    <asp:ListItem Selected="True">ShowArrow</asp:ListItem>
                    <asp:ListItem>OnlyLine</asp:ListItem>
                    <asp:ListItem>Unvisible</asp:ListItem>
                </asp:DropDownList><br />
                <br />
                <span style="font-size: 8pt">The sum item rectangle appeared in the parent row can be
                    hidden, when the parent row is expanded and children items are visible. Uncheck
                    following checkbox; notice, the sum item in the �<em>Laboratory</em>� row disappears.</span><br />
                <asp:CheckBox ID="HideExpandedRowSumCheck" runat="server" Text="ViewOptions.HideExpandedRowSum:" TextAlign="Left" AutoPostBack="True" /></div> 
            </td>
        </tr>
    </table>
    <span style="font-size: 8pt">Notice, many scheduler properties, especially appearance
        and behavior properties, are not serialized between particularly requests.
        Therefore, if you initialize these properties from the page code, keep in mind you
        need do it every request, regardless of the <em>Page.IsPostback</em> property.<br />
        However, if you use standard properties setting with helping design mode and properties
        window, don�t worry, the automatically generated by the ASP.NET interpreter code
        does it for you. So, you just choose proper property value in the property grid,
        that�s all.</span>


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