<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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 runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <script type="text/javascript">
        var selectedValue = "-";
        function OnClientSelectedIndexChanging(sender, eventArgs) {            
            selectedValue = eventArgs.get_item().get_value();           
            var scheduler = $find('<%=RadScheduler1.ClientID %>');
            scheduler.rebind();
        }
        function OnClientAppointmentsPopulating(sender, eventArgs) { 
            eventArgs.get_schedulerInfo().FilterValue = selectedValue;
            selectedValue = "-";
        }
    </script>
    <telerik:RadComboBox ID="RadComboBox1" runat="server" OnClientSelectedIndexChanging="OnClientSelectedIndexChanging" Label="Filter appointments by resource (teacher): ">
        <Items>
            <telerik:RadComboBoxItem runat="server" Text="-" Value="-" />
            <telerik:RadComboBoxItem runat="server" Text="Mr John Doe" Value="1" />
            <telerik:RadComboBoxItem runat="server" Text="Mrs Jane Smith" Value="2" />
           
        </Items>
    </telerik:RadComboBox>
    <telerik:RadScheduler ID="RadScheduler1" runat="server" OnClientAppointmentsPopulating="OnClientAppointmentsPopulating">
        <WebServiceSettings Path="SchedulerWebService.asmx" ResourcePopulationMode="ServerSide" />
    </telerik:RadScheduler>
    </form>
</body>
</html>
