Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
76 views
To deal with issues of translations for the radGrid I call a routine that looks at the value in various string properties and then do a translation if needed (i.e. the string would be something like %Resource%Mnemonic%) with routines to show the mnemonic on screen for debugging as [Resource].[Mnemonic].

There's a difference in behaviour between how the Grid behaves with these two lines:
  • grid.MasterTableView.CommandItemSettings.RefreshText =
  • ResourceTranslation.TranslateField(grid.MasterTableView.CommandItemSettings.RefreshText);
  • grid.MasterTableView.Caption =
  • ResourceTranslation.TranslateField(grid.MasterTableView.Caption);
    •  

      I would expect them to behave the same...

       

      On the initial get I get:


       

      [CurrentPage].[AccountSummaryTable]

       

    and [MasterPage].[Grid_RefreshText]   
    as expected.

    On a post back, it changes to:
    [Error].[[CurrentPage].[AccountSummaryTable]]
    and [MasterPage].[Grid_RefreshText]   

    In other words -- one property appears to be getting it from the original properties and the other from the current properties.

    The bug is the inconsistancy. I can easily code around it -- but I thought it should be reported.
    Ken Lassesen
    Top achievements
    Rank 2
     answered on 19 Feb 2010
    5 answers
    166 views
    Hey Guys,

    I am attempting to create a schedule that will track nurse jobs/availabilies.

    For this, I have created a resource called 'Facilitator' (the nurse).

    I am trying to implement the Resource Avalability Demo from the telerik site, so that a single Facilitator cannot be double booked, and keep running into the following error with the javascript -

    • appointment.get_resources is not a function

    This is doing me head in, so any assistance would be appeciated.

    BTW - RadControls for ASP.NET AJAX Q2 2009

    in the function isFacilitatorOccupied the first line of code is -

    • var currentFacilitator = appointment.get_resources().getResourcesByType("Facilitator").getResource(0);

    .aspx page

    <%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %> 
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
     
    <!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> 
        <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" /> 
        <link href="cssStyle.css" rel="stylesheet" type="text/css" /> 
    </head> 
    <body> 
        <form id="form1" runat="server" method="post"> 
         
        <h1>Medical Schedule</h1> 
         
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> 
            <Scripts> 
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> 
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> 
            </Scripts> 
        </telerik:RadScriptManager> 
         
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> 
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadScheduler1"> 
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
         
        <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" /> 
     
        <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Default" /> 
         
        <script type="text/javascript"> 
            /* <![CDATA[ */    
                /* Helper functions */
                
                /// <summary>
                ///        Returns the appointments in the specified period filtered by the specified resource.
                /// </summary>
                /// <param name="scheduler">
                ///        RadScheduler's client-side object
                /// </param>
                /// <param name="start" type="Date">
                ///        The start of the period 
                /// </param>
                /// <param name="end" type="Date">
                ///        The end of the period
                /// </param>
                /// <param name="resource">
                ///        The resource (room or user) to filter by
                /// </param>
                /// <param name="appointment">
                ///        The current appointment
                /// </param>
                function getAppointmentsInRangeByResource(scheduler, start, end, resource, appointment)
                {
                    //Get all appointments within the specified time period
                    var result = scheduler.get_appointments().getAppointmentsInRange(start, end);
                    
                    //If specified remove the appointment from the appointment list
                    if (appointment)
                        result.remove(appointment);
                    
                    //Filter the appointments based on the resource
                    return result.findByResource(resource);
                }
                
                /// <summary>
                ///        Checks if the user associated with the specified appointment has another 
                ///        appointment in the specified time period
                /// </sumary>
                /// <param name="scheduler">
                ///        RadScheduler's client-side object
                /// </param>
                /// <param name="start" type="Date">
                ///        The start of the period 
                /// </param>
                /// <param name="end" type="Date">
                ///        The end of the period
                /// </param>
                /// <param name="appointment">
                ///        The current appointment
                /// </param>
                
                
                function isFacilitatorOccupied(scheduler, start, end, appointment)
                {
                    //get the "User" resource associated with the appointment
                    var currentFacilitator = appointment.get_resources().getResourcesByType("Facilitator").getResource(0);
                    
                    //get all appointments in this period which are associated with this resource
                    var appointmentsForThisFacilitator = getAppointmentsInRangeByResource(scheduler, start, end, currentFacilitator, appointment);
                    
                    //if the list of appointments is not empty the user has other appointments besides the specified in this time period
                    return appointmentsForThisFacilitator.get_count() > 0;
                }
                function warnIfOccupied(start, end, sender, args)
                {
                    var slot = args.get_targetSlot();
                    var appointment = args.get_appointment();
                    if (isFacilitatorOccupied(sender, start, end, appointment))
                    {
                        alert("This Facilitator is occupied in this time period.");
                        args.set_cancel(true);
                    }
                    
                    appointment.get_element().style.border = "";
                }
                /// <summary>
                ///        Checks if the specified time slot is occupied and visually shows it to the user.
                ///        Called by the resizeing and moving client-side event handlers.
                /// </sumary>
                function highlightIfOccupied(start, end, sender, args)
                {
                    alert("4");
                    
                    var appointment = args.get_appointment();
                    var slot = args.get_targetSlot();
                    if (isFacilitatorOccupied(sender, start, end, appointment))
                    { 
                        appointment.get_element().style.border = "1px solid red";
                        return;
                    }
                    
                    appointment.get_element().style.border = "";
                }
                
                function onAppointmentResizing(sender, args)
                {
                    var start = args.get_appointment().get_start();
                    var end = args.get_targetSlot().get_endTime();
                    highlightIfOccupied(start, end, sender, args);
                }
                
                function onAppointmentResizeEnd(sender, args)
                {
                    var start = args.get_appointment().get_start();
                    var end = args.get_targetSlot().get_endTime();
                    
                    warnIfOccupied(start, end, sender, args);
                }
                
                function onAppointmentMoving(sender, args)
                {
                    var start = args.get_targetSlot().get_startTime();
                    var end = new Date(start.getTime() + args.get_appointment().get_duration());
                    highlightIfOccupied(start, end, sender, args);
                }
                
                function onAppointmentMoveEnd(sender, args)
                {
                    var start = args.get_targetSlot().get_startTime();
                    var end = new Date(start.getTime() + args.get_appointment().get_duration());
                    
                    warnIfOccupied(start, end, sender, args);
                }
            
                function onAppointmentInserting(sender, args)
                {
                    var slot = args.get_targetSlot();
                    var start = slot.get_startTime();
                    var end = slot.get_endTime();
                    if (isFacilitatorOccupied(sender, start, end, slot))
                    {
                        alert("This Facilitator is not available in this time period.");
                        args.set_cancel(true);
                    }
                }
            /* ]]> */ 
            </script> 
         
        <div> 
         
        <table cellspacing="0" cellpadding="5" class="Refinement"> 
        <tr valign="top"> 
            <td><h3>State:</h3></td> 
            <td><h3>Group By:</h3></td> 
            <td><h3>Direction:</h3></td> 
            <td><asp:Label ID="lblStates" runat="server" Text="Test Label" Visible="false" /></td> 
        </tr> 
        <tr valign="top"> 
            <td> 
                <asp:CheckBoxList runat="server" id="chkState" RepeatLayout="Table" RepeatDirection="Horizontal" RepeatColumns="5" Width="400px"> 
                <asp:ListItem Text="ACT" Value="ACT" /> 
                <asp:ListItem Text="NSW" Value="NSW" /> 
                <asp:ListItem Text="NT" Value="NT" /> 
                <asp:ListItem Text="NZ" Value="NZ" /> 
                <asp:ListItem Text="QLD" Value="QLD" /> 
                <asp:ListItem Text="SA" Value="SA" /> 
                <asp:ListItem Text="TAS" Value="TAS" /> 
                <asp:ListItem Text="VIC" Value="VIC" /> 
                <asp:ListItem Text="WA" Value="WA" /> 
                </asp:CheckBoxList> 
            </td> 
            <td> 
                <telerik:RadComboBox ID="ddlGroupBy" Runat="server" > 
                <Items> 
                <telerik:RadComboBoxItem runat="server" Selected="True" Text="None" /> 
                <telerik:RadComboBoxItem runat="server" Text="Activity" Value="Activity" /> 
                <telerik:RadComboBoxItem runat="server" Text="Facilitator" Value="Facilitator" /> 
                <telerik:RadComboBoxItem runat="server" Text="Client" Value="Client" /> 
                <telerik:RadComboBoxItem runat="server" Text="State" Value="State" /> 
                </Items> 
                </telerik:RadComboBox> 
            </td> 
            <td> 
                <telerik:RadComboBox ID="ddlGroupingDirection" Runat="server"> 
                <Items> 
                <telerik:RadComboBoxItem runat="server" Text="Vertical" Value="Vertical" Selected="True" /> 
                <telerik:RadComboBoxItem runat="server" Text="Horizontal" Value="Horizontal" /> 
                </Items> 
                </telerik:RadComboBox> 
            </td> 
            <td><asp:ImageButton runat="server" ID="btnSubmit_Refinement" ImageUrl="images/buttons/btnSubmit_Refinement.jpg" /></td> 
        </tr> 
        </table>        
         
        <br /> 
         
         
        <br /> 
     
        <telerik:RadScheduler ID="RadScheduler1" runat="server"  
                DataKeyField="ID" DataSourceID="dsSchedule" DataStartField="Start" DataEndField="End" DataSubjectField="Subject"   
                DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID" 
                HoursPanelTimeFormat="htt" MinutesPerRow="15"  
                ValidationGroup="RadScheduler1" Height="700px" Skin="WebBlue" 
                Culture="English (Australia)" WorkDayEndTime="18:00:00"  
                FirstDayOfWeek="Monday" RowHeaderWidth="100px" 
                StartInsertingInAdvancedForm="True"  
                OnAppointmentCreated="RadScheduler1_AppointmentCreated" 
                OnClientAppointmentInserting="onAppointmentInserting" 
                OnClientAppointmentMoving="onAppointmentMoving" OnClientAppointmentMoveEnd="onAppointmentMoveEnd" 
                OnClientAppointmentResizing="onAppointmentResizing" OnClientAppointmentResizeEnd="onAppointmentResizeEnd"> 
                 
                 
            <ResourceTypes> 
                <telerik:ResourceType DataSourceID="dsActivity"    ForeignKeyField="Activity_ID"     KeyField="Activity_ID"    Name="Activity"    TextField="Activity_Name"  /> 
                <telerik:ResourceType DataSourceID="dsFacilitator" ForeignKeyField="Facilitator_ID"  KeyField="Facilitator_ID" Name="Facilitator" TextField="FirstName" /> 
                <telerik:ResourceType DataSourceID="dsClient"      ForeignKeyField="Client_ID"       KeyField="Client_ID"      Name="Client"      TextField="Client_Name" /> 
                <telerik:ResourceType DataSourceID="dsState"       ForeignKeyField="State"           KeyField="State"          Name="State"       TextField="State" /> 
            </ResourceTypes> 
             
            <Localization AdvancedAllDayEvent="All day"></Localization> 
            <AdvancedForm DateFormat="d/MM/yyyy" TimeFormat="h:mm tt"></AdvancedForm> 
            <TimelineView UserSelectable="false" /> 
            <MultiDayView UserSelectable="false" /> 
             
            <AppointmentTemplate> 
                <%# Eval("Client.Text") %> - <%# Eval("Activity.Text") %> - <%# Eval("Facilitator.Text") %> 
            </AppointmentTemplate> 
             
            <InlineInsertTemplate> 
                <asp:TextBox runat="server" ID="SubjectTextBox" Text='<%# Bind("Subject") %>' Width="99%"></asp:TextBox> 
                <div class="UserToolbox"> 
                 User:&nbsp; 
                 <telerik:RadComboBox runat="server" ID="FacilitatorComboBox" DataTextField="Facilitator_Display" DataValueField="Facilitator_ID" 
                     Width="80px" Skin="Office2007" SelectedValue='<%# Bind("Facilitator_ID") %>' DataSource='<%# GetAvailableFacilitators(Container) %>'> 
                 </telerik:RadComboBox>&nbsp; 
                 <asp:LinkButton runat="server" ID="InsertLinkButton" CommandName="Insert" Text="Insert"></asp:LinkButton>&nbsp; 
                 <asp:LinkButton runat="server" ID="CancelLinkButton" CommandName="Cancel" Text="Cancel"></asp:LinkButton> 
                </div> 
            </InlineInsertTemplate> 
             
            <InlineEditTemplate> 
                <asp:TextBox runat="server" ID="SubjectTextBox" Text='<%# Bind("Subject") %>' Width="99%"></asp:TextBox> 
                <div class="UserToolbox"> 
                 User:&nbsp; 
                 <telerik:RadComboBox runat="server" ID="FacilitatorComboBox" DataTextField="Facilitator_Display" DataValueField="Facilitator_ID" 
                     Width="80px" Skin="Office2007" SelectedValue='<%# Bind("Facilitator_ID") %>' DataSource='<%# GetAvailableFacilitators(Container) %>' > 
                 </telerik:RadComboBox>&nbsp; 
                 <asp:LinkButton runat="server" ID="UpdateLinkButton" CommandName="Update" Text="Update"></asp:LinkButton>&nbsp; 
                 <asp:LinkButton runat="server" ID="CancelLinkButton" CommandName="Cancel" Text="Cancel"></asp:LinkButton> 
                </div> 
            </InlineEditTemplate> 
     
             
        </telerik:RadScheduler> 
     
            <asp:SqlDataSource ID="dsSchedule" runat="server"  
                ConnectionString="<%$ ConnectionStrings:ScheduleConnectionString %>"  
                SelectCommand="SELECT [ID], [Subject], [Start], [End], [Facilitator_ID], [RecurrenceRule], [RecurrenceParentID], [Annotations], [Activity_ID], [Client_ID], [Comments], [State] FROM [Appointments]"  
                ConflictDetection="CompareAllValues"  
                DeleteCommand="DELETE FROM [Appointments] WHERE [ID] = @original_ID AND [Subject] = @original_Subject AND [Start] = @original_Start AND [End] = @original_End AND (([Facilitator_ID] = @original_Facilitator_ID) OR ([Facilitator_ID] IS NULL AND @original_Facilitator_ID IS NULL)) AND (([RecurrenceRule] = @original_RecurrenceRule) OR ([RecurrenceRule] IS NULL AND @original_RecurrenceRule IS NULL)) AND (([RecurrenceParentID] = @original_RecurrenceParentID) OR ([RecurrenceParentID] IS NULL AND @original_RecurrenceParentID IS NULL)) AND (([Annotations] = @original_Annotations) OR ([Annotations] IS NULL AND @original_Annotations IS NULL)) AND (([Activity_ID] = @original_Activity_ID) OR ([Activity_ID] IS NULL AND @original_Activity_ID IS NULL)) AND (([Client_ID] = @original_Client_ID) OR ([Client_ID] IS NULL AND @original_Client_ID IS NULL)) AND (([Comments] = @original_Comments) OR ([Comments] IS NULL AND @original_Comments IS NULL)) AND (([State] = @original_State) OR ([State] IS NULL AND @original_State IS NULL))"  
                InsertCommand="INSERT INTO [Appointments] ([Subject], [Start], [End], [Facilitator_ID], [RecurrenceRule], [RecurrenceParentID], [Annotations], [Activity_ID], [Client_ID], [Comments], [State]) VALUES (@Subject, @Start, @End, @Facilitator_ID, @RecurrenceRule, @RecurrenceParentID, @Annotations, @Activity_ID, @Client_ID, @Comments, @State)"  
                OldValuesParameterFormatString="original_{0}"  
                UpdateCommand="UPDATE [Appointments] SET [Subject] = @Subject, [Start] = @Start, [End] = @End, [Facilitator_ID] = @Facilitator_ID, [RecurrenceRule] = @RecurrenceRule, [RecurrenceParentID] = @RecurrenceParentID, [Annotations] = @Annotations, [Activity_ID] = @Activity_ID, [Client_ID] = @Client_ID, [Comments] = @Comments, [State] = @State WHERE [ID] = @original_ID AND [Subject] = @original_Subject AND [Start] = @original_Start AND [End] = @original_End AND (([Facilitator_ID] = @original_Facilitator_ID) OR ([Facilitator_ID] IS NULL AND @original_Facilitator_ID IS NULL)) AND (([RecurrenceRule] = @original_RecurrenceRule) OR ([RecurrenceRule] IS NULL AND @original_RecurrenceRule IS NULL)) AND (([RecurrenceParentID] = @original_RecurrenceParentID) OR ([RecurrenceParentID] IS NULL AND @original_RecurrenceParentID IS NULL)) AND (([Annotations] = @original_Annotations) OR ([Annotations] IS NULL AND @original_Annotations IS NULL)) AND (([Activity_ID] = @original_Activity_ID) OR ([Activity_ID] IS NULL AND @original_Activity_ID IS NULL)) AND (([Client_ID] = @original_Client_ID) OR ([Client_ID] IS NULL AND @original_Client_ID IS NULL)) AND (([Comments] = @original_Comments) OR ([Comments] IS NULL AND @original_Comments IS NULL)) AND (([State] = @original_State) OR ([State] IS NULL AND @original_State IS NULL))"> 
                <DeleteParameters> 
                    <asp:Parameter Name="original_ID" Type="Int32" /> 
                    <asp:Parameter Name="original_Subject" Type="String" /> 
                    <asp:Parameter Name="original_Start" Type="DateTime" /> 
                    <asp:Parameter Name="original_End" Type="DateTime" /> 
                    <asp:Parameter Name="original_Facilitator_ID" Type="Int32" /> 
                    <asp:Parameter Name="original_RecurrenceRule" Type="String" /> 
                    <asp:Parameter Name="original_RecurrenceParentID" Type="Int32" /> 
                    <asp:Parameter Name="original_Annotations" Type="String" /> 
                    <asp:Parameter Name="original_Activity_ID" Type="Int32" /> 
                    <asp:Parameter Name="original_Client_ID" Type="Int32" /> 
                    <asp:Parameter Name="original_Comments" Type="String" /> 
                    <asp:Parameter Name="original_State" Type="String" /> 
                </DeleteParameters> 
                <UpdateParameters> 
                    <asp:Parameter Name="Subject" Type="String" /> 
                    <asp:Parameter Name="Start" Type="DateTime" /> 
                    <asp:Parameter Name="End" Type="DateTime" /> 
                    <asp:Parameter Name="Facilitator_ID" Type="Int32" /> 
                    <asp:Parameter Name="RecurrenceRule" Type="String" /> 
                    <asp:Parameter Name="RecurrenceParentID" Type="Int32" /> 
                    <asp:Parameter Name="Annotations" Type="String" /> 
                    <asp:Parameter Name="Activity_ID" Type="Int32" /> 
                    <asp:Parameter Name="Client_ID" Type="Int32" /> 
                    <asp:Parameter Name="Comments" Type="String" /> 
                    <asp:Parameter Name="State" Type="String" /> 
                    <asp:Parameter Name="original_ID" Type="Int32" /> 
                    <asp:Parameter Name="original_Subject" Type="String" /> 
                    <asp:Parameter Name="original_Start" Type="DateTime" /> 
                    <asp:Parameter Name="original_End" Type="DateTime" /> 
                    <asp:Parameter Name="original_Facilitator_ID" Type="Int32" /> 
                    <asp:Parameter Name="original_RecurrenceRule" Type="String" /> 
                    <asp:Parameter Name="original_RecurrenceParentID" Type="Int32" /> 
                    <asp:Parameter Name="original_Annotations" Type="String" /> 
                    <asp:Parameter Name="original_Activity_ID" Type="Int32" /> 
                    <asp:Parameter Name="original_Client_ID" Type="Int32" /> 
                    <asp:Parameter Name="original_Comments" Type="String" /> 
                    <asp:Parameter Name="original_State" Type="String" /> 
                </UpdateParameters> 
                <InsertParameters> 
                    <asp:Parameter Name="Subject" Type="String" /> 
                    <asp:Parameter Name="Start" Type="DateTime" /> 
                    <asp:Parameter Name="End" Type="DateTime" /> 
                    <asp:Parameter Name="Facilitator_ID" Type="Int32" /> 
                    <asp:Parameter Name="RecurrenceRule" Type="String" /> 
                    <asp:Parameter Name="RecurrenceParentID" Type="Int32" /> 
                    <asp:Parameter Name="Annotations" Type="String" /> 
                    <asp:Parameter Name="Activity_ID" Type="Int32" /> 
                    <asp:Parameter Name="Client_ID" Type="Int32" /> 
                    <asp:Parameter Name="Comments" Type="String" /> 
                    <asp:Parameter Name="State" Type="String" /> 
                </InsertParameters> 
            </asp:SqlDataSource> 
     
        </div> 
         
         
         
         
        <asp:SqlDataSource ID="dsActivity" runat="server"  
            ConnectionString="<%$ ConnectionStrings:ScheduleConnectionString %>"  
            SelectCommand="SELECT [Activity_ID], [Activity_Name], [Description], [Appt_Duration], [Acronym], [Status] FROM [Activity]"> 
        </asp:SqlDataSource> 
         
        <asp:SqlDataSource ID="dsFacilitator" runat="server"  
            ConnectionString="<%$ ConnectionStrings:ScheduleConnectionString %>"  
            SelectCommand="SELECT [Facilitator_ID], [FirstName], [LastName], [Phone1], [Phone2], [Phone3], [Email1], [Email2], [Status], [LastName] + ', ' + [FirstName] As [Facilitator_Display] FROM [Facilitator]"> 
        </asp:SqlDataSource> 
         
        <asp:SqlDataSource ID="dsClient" runat="server"  
            ConnectionString="<%$ ConnectionStrings:ScheduleConnectionString %>"  
            SelectCommand="SELECT [Client_ID], [Client_Code], [Client_Name], [Client_Address], [Client_Contact_FirstName], [Client_Contact_LastName], [Client_Phone1], [Client_Phone2], [Client_Phone3], [Client_Email1], [Client_Email2], [Client_Status] FROM [Client]"> 
        </asp:SqlDataSource> 
         
        <asp:SqlDataSource ID="dsState" runat="server"  
            ConnectionString="<%$ ConnectionStrings:ScheduleConnectionString %>"  
            SelectCommand="SELECT [State], [TimeZoneOffset], [HasDaylightSaving] FROM [State]"> 
        </asp:SqlDataSource> 
     
         
         
         
         
        </form> 
    </body> 
    </html> 
     

    aspx.vb page

    Imports Telerik.Web.UI 
    Imports System.Web.Security 
    Imports System.Web.UI.WebControls 
    Imports System.Data 
    Imports System.Data.Common 
    Imports System.Data.SqlClient 
    Imports System.Drawing 
    Imports System.Collections 
    Imports System.Collections.Generic 
     
    Partial Class _Default 
        Inherits System.Web.UI.Page 
     
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
     
        End Sub 
     
        Protected Sub RadScheduler1_AppointmentDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.SchedulerEventArgs) Handles RadScheduler1.AppointmentDataBound 
            If e.Appointment.Resources.GetResourceByType("Client") <> Nothing Then 
                Select Case e.Appointment.Resources.GetResourceByType("Client").Text 
                    Case "Client1" 
                        e.Appointment.CssClass = "rsCategoryBlue" 
                        Exit Select 
                    Case "Client2" 
                        e.Appointment.CssClass = "rsCategoryOrange" 
                        Exit Select 
                    Case "Client13" 
                        e.Appointment.CssClass = "rsCategoryGreen" 
                        Exit Select 
                    Case Else 
                        Exit Select 
                End Select 
            End If 
        End Sub 
         
     
        Protected Sub btnSubmit_Refinement_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnSubmit_Refinement.Click 
     
            RadScheduler1.GroupBy = ddlGroupBy.SelectedValue 
     
            RadScheduler1.GroupingDirection = DirectCast([Enum].Parse(GetType(GroupingDirection), ddlGroupingDirection.SelectedValue), GroupingDirection) 
     
            If chkState.SelectedIndex > -1 Then 
     
                Dim myStateRefinement As String = "" 
     
                For Each li As ListItem In chkState.Items 
                    If li.Selected = True Then 
     
                        If myStateRefinement = "" Then 
                            myStateRefinement = "State = '" & li.Value & "'" 
                        Else 
                            myStateRefinement += " OR State = '" & li.Value & "'" 
                        End If 
     
                    End If 
                Next 
     
                dsState.SelectCommand = "Select * FROM State where " & myStateRefinement 
                dsState.DataBind() 
     
                dsSchedule.SelectCommand = "Select * FROM Appointments where " & myStateRefinement 
                dsSchedule.DataBind() 
     
            End If 
     
        End Sub 
     
        Protected Sub RadScheduler1_AppointmentCreated(ByVal sender As Object, ByVal e As AppointmentCreatedEventArgs) 
            Dim Facilitator As Resource = e.Appointment.Resources.GetResourceByType("Facilitator") 
     
            'Dim assignedTo As Label = DirectCast(e.Container.FindControl("AssignedTo"), Label) 
            'assignedTo.Text = "Held by: " + Facilitator.Text 
        End Sub 
     
        Protected Function GetAvailableFacilitators(ByVal container As Control) As IEnumerable 
            Dim appointment As Appointment = (DirectCast(container, SchedulerFormContainer)).Appointment 
     
            Dim availableFacilitator As New List(Of Resource)(RadScheduler1.Resources.GetResourcesByType("Facilitator")) 
            For Each appointmentInRange As Appointment In RadScheduler1.Appointments.GetAppointmentsInRange(appointment.Start, appointment.[End]) 
                If appointmentInRange Is appointment Then 
                    Continue For 
                End If 
     
                For Each occupiedFacilitator As Resource In appointmentInRange.Resources.GetResourcesByType("Facilitator") 
                    availableFacilitator.Remove(occupiedFacilitator) 
                Next 
            Next 
     
            Return availableFacilitator 
        End Function 
    End Class 
     
     

    If anybody can steer me in the right direction, would fantastic.

    Cheers,
    Steve
    El-Perko
    Top achievements
    Rank 1
     answered on 18 Feb 2010
    4 answers
    225 views
    I have been having a problem on my page where clicking on the button doesn't appear to cause a post-back (although stepping through the code shows that it is going through the lines of code in the code behind page.

    I created a new simple project and have been able to reproduce the issue:

    Default.aspx:
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> 
     
    <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="rad" %> 
     
    <!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">  
            <div> 
                <asp:Panel class="clientheading" ID="Panel1" runat="server" BorderWidth="0px" Visible="False">  
                    <asp:Label ID="header1" runat="server" >Test</asp:Label>&nbsp;  
                </asp:Panel> 
                  
                  
                <rad:RadScriptManager runat="server" ID="RadScriptManager1" /> 
                  
                <rad:RadAjaxManager ID="RadAjaxManager1" runat="server">  
                    <AjaxSettings> 
                        <rad:AjaxSetting AjaxControlID="checkbox1">  
                            <UpdatedControls> 
                                <rad:AjaxUpdatedControl ControlID="label1" /> 
                                <rad:AjaxUpdatedControl ControlID="button1" /> 
                                <rad:AjaxUpdatedControl ControlID="lblMessage" /> 
                            </UpdatedControls> 
                        </rad:AjaxSetting> 
                    </AjaxSettings> 
                </rad:RadAjaxManager> 
                  
              
            </div> 
            <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label> 
            <table id="Table1" runat="server">  
                <tr> 
                    <td><asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" /></td>  
                </tr> 
                <tr> 
                    <td><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></td>  
                </tr> 
            </table> 
            <table id="Table2" runat="server">  
                <tr> 
                    <td><asp:Button ID="Button1" runat="server" Text="Not checked" /></td>  
                </tr> 
            </table> 
          
        </form> 
    </body> 
    </html> 
     

    Code behind file:
    Partial Class _Default  
        Inherits System.Web.UI.Page  
     
        Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click  
     
            If Not Me.CheckBox1.Checked Then 
                Me.lblMessage.Text = "Not checked" 
                Me.lblMessage.Visible = True 
            Else 
                Response.Redirect("page2.aspx")  
            End If 
     
        End Sub 
     
        Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged  
            Me.lblMessage.Text = "" 
            Me.Label1.Text = "Checked = " & Me.CheckBox1.Checked.ToString  
            If Me.CheckBox1.Checked Then 
                Me.Button1.Text = "Checked" 
            Else 
                Me.Button1.Text = "Not Checked" 
            End If 
        End Sub 
    End Class 

    What I expect to happen is that when the user clicks on the button with the checkbox un-checked, the lblMessage would show the text "Not checked".  As noted above, stepping through the code shows that the line is executed, but it doesn't show on the page.

    If I comment out or remove the following line on the aspx page and then run the project again, clicking on the button with the checkbox un-checked produces the desired result.

    <

     

    rad:AjaxUpdatedControl ControlID="button1" />

     


    Any ideas as to what could be causing the problem?

    I note that the Telerik Ajax Manager version is v2009.2.826.20 (as shown on the aspx page).


    Rem
    Top achievements
    Rank 1
     answered on 18 Feb 2010
    1 answer
    116 views
    I have created a rule with the rewrite the will allow the user to navigate to the default page for a specific criteria like so.  Website.com/Products  will be rewritten to website.com/Deafult.aspx?type=Products.This works fine the issue is on this page I have a telerik radgrid that allows for grouping.  I have a RadAjaxmanager for the grid.  The problem is when even I try to collapse it will collapse but I get an error on page and I cannot expand or collapse any other groups in the grid. 

    Webpage error details 
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; MDDS; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; .NET CLR 3.5.30729; MSSDMC1.3.1020.3; MSSDMC2.5.2219.1)
    Message: Sys.ScriptLoadFailedException: The script 'http://gofilepointtest.fairviewinvest.com/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ContentPlaceHolder1_RadScriptManager1_HiddenField&compress=1&_TSM_CombinedScripts_=%3b' could not be loaded.

    This only seems to happen in ie due to the fact that in firefox when I hit the collapse button the url changes to show the page and the query string.

    IE show the telrik grid with the skins, but in firefox it does not show the telerik skins

    Eric Klein
    Top achievements
    Rank 1
     answered on 18 Feb 2010
    2 answers
    133 views
    I am using a radcalendar control with multi selection and userowheaderstoselectrows enabled. It works fine. But I have a requirement to select all wednesdays within a certain date range. Is there a built in mechanism available in the radcalendar that will let me do that? If not and if I end up writing custom code to accomplish that, how do I select multiple dates on server side?

    Thank you,
    Vithiya
    Vithiya
    Top achievements
    Rank 1
     answered on 18 Feb 2010
    2 answers
    63 views
    Hi I just installed RAD editor on our test MOSS server and everything worked perfectly.
    When I try and install the RAD editor on our production MOSS server the editor does not render properly.

    I have attached a screen shot of how the editor looks in IE 8. In Firefox I can see the editor but it is frozen.

    Any help would be appreciated.
    Thank You

     
    Victor Gatnicki
    Top achievements
    Rank 1
     answered on 18 Feb 2010
    2 answers
    141 views
    Hi, I'm trying to create an app kind of like the style of meebo with a ton of windows moving around. I have a question that I can't seem to figure out. So from the main page, I create a RadWindow. Now within the Radwindow I want to allow the user to click on a button to open another RadWindow that is the same level as the first RadWindow. If I open the window through a RadWindowManager inside the the first window, the new window will be restricted inside the first window. So I guess, I need access to RadWindowManager of the first RadWindow in order to create another RadWindow at the same level.

    So my question is, how can I access the RadWindowManager of a RadWindow from within it, from server side code?

    Any help would be great.

    Thanks!

    elmosi
    Top achievements
    Rank 2
     answered on 18 Feb 2010
    2 answers
    167 views
    Hi, I am new in RadChart.
    I have a dataset with some value in this format:
    Date,Value.
    (1 value every minute)
    I must show in a radchart (line) Y axis the values and in the x-axis the day (date dd/mm/yy).
    I have to show 30 day (fixed 30). Only one label for day.
    After MANY times I can show line but in x-axis I see label 1,2,3,4,etc.
    How can I show only 30 step with a date in every step?
    Hope my english is well (i am italian).
    I think documentation or example are not very good. I haven't see something about use of dates.
    And in the real life, dates and hours are a really important.
    Thanks.
    Flavio Balbo
    Flavio Balbo
    Top achievements
    Rank 2
     answered on 18 Feb 2010
    7 answers
    349 views

    I have looked through the threads and the link provided for setting the 'context' parameter to pass to a web service, but I am not getting it to work.  I am sure it's something straightforward that I have missed.  For simplicity, I had the Javascript function simply load a literal value rather than the value of an existing page control.  When I click on the combo box, i get the error "Invalid web service call, missing value for parameter 'ctx' "  Here are the code snippets:

     

    <telerik:RadComboBox ID="cboSMAList" runat="server" EmptyMessage="None" Width="230px" EnableLoadOnDemand="true" OnClientItemsRequesting="CurrentInvestorForSMA" >

     

     

    <WebServiceSettings Path="~/ws/ADAdvisorMaintService.asmx" Method="SMAList" />

     

     

    </telerik:RadComboBox>

     



     

    function CurrentInvestorForSMA(sender, eventArgs) {

     

     

    var context = eventArgs.get_context();

     

    context[

    "InvID"] = "2";

     

    }

     


    And here's the Web service piece:


    [

    WebMethod]

     

     

    public RadComboBoxItemData[] SMAList(object ctx )

     

    {

     

    int invID = 0;

     

     

    IDictionary<string, object> contextDictionary = (IDictionary<string, object>) ctx;

     

    invID =

    Convert.ToInt32(contextDictionary["InvID"]);

    Thanks,
    S.

     

    Shahryar Ali
    Top achievements
    Rank 1
     answered on 18 Feb 2010
    1 answer
    103 views
    I'm binding nodes on the server. These nodes can consist of multiple levels. On the client the tree is rendered expanded. When I collapse and re-expand a parent node, it calls the web service populating it's children. This creates duplicate records. Is there a way to prevent the web service call from populating duplicate records?

    Thanks,

    Chuck
    Schlurk
    Top achievements
    Rank 2
     answered on 18 Feb 2010
    Narrow your results
    Selected tags
    Tags
    +? more
    Top users last month
    Jake
    Top achievements
    Rank 1
    RBarnes
    Top achievements
    Rank 1
    Iron
    Iron
    Rami
    Top achievements
    Rank 1
    Iron
    Veteran
    Nathan
    Top achievements
    Rank 1
    Kumeri
    Top achievements
    Rank 1
    Iron
    Veteran
    Iron
    Want to show your ninja superpower to fellow developers?
    Top users last month
    Jake
    Top achievements
    Rank 1
    RBarnes
    Top achievements
    Rank 1
    Iron
    Iron
    Rami
    Top achievements
    Rank 1
    Iron
    Veteran
    Nathan
    Top achievements
    Rank 1
    Kumeri
    Top achievements
    Rank 1
    Iron
    Veteran
    Iron
    Want to show your ninja superpower to fellow developers?
    Want to show your ninja superpower to fellow developers?