RadSchedular doesn't update when radCalendar clicked

2 posts, 1 answers
  1. ProgrammerNet
    ProgrammerNet avatar
    5 posts
    Member since:
    Oct 2013

    Posted 18 Apr Link to this post

    Dear All,

    I´m pretty new to Telrik controls and have the following question.
    I want to Update in real time my radSchedular when clicking on RadCalendar like illustrated in this sample:
    http://demos.telerik.com/aspnet-ajax/scheduler/examples/overview/defaultcs.aspx,
    The radSchedulat doesn't synchronise when i click to a date on RadCalendar date: Could you help me to find the source of the issue please?
    Source code:
     <telerik:radscheduler runat="server" id="RadScheduler1"
                        DataKeyField="ID" DataSubjectField="Subject" DataStartField="Start" DataEndField="End" DataDescriptionField="Description"
                        DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentId" DataReminderField="Reminder"
                        OnAppointmentDataBound="DiaryRadScheduler_AppointmentDataBound" OnAppointmentCommand="DiaryRadScheduler_AppointmentCommand"
                        AllowDelete="false" AllowEdit="false" AllowInsert="false" EnableDescriptionField="true"
                        EnableRecurrenceSupport="false" EnableResourceEditing="false" EnableExactTimeRendering="false"
                        DayStartTime="08:00:00" DayEndTime="20:00:00" WorkDayStartTime="09:00:00" WorkDayEndTime="18:00:00"
                        WeekView-DayStartTime="08:00:00" WeekView-DayEndTime="20:00:00" WeekView-WorkDayStartTime="09:00:00" WeekView-WorkDayEndTime="18:00:00" WeekView-EnableExactTimeRendering="true"
                        MultiDayView-DayStartTime="08:00:00" MultiDayView-DayEndTime="20:00:00" MultiDayView-WorkDayStartTime="09:00:00" MultiDayView-WorkDayEndTime="20:00:00" MultiDayView-NumberOfDays="5" MultiDayView-EnableExactTimeRendering="true"
                        AppointmentStyleMode="Auto" SelectedView="AgendaView"
                        StartEditingInAdvancedForm="true" StartInsertingInAdvancedForm="true"
                        ShowHeader="true" ShowFooter="true" ShowAllDayRow="false" ShowDateHeaders="true" ShowFullTime="false" OverflowBehavior="Expand"
                        RowHeight="25px" RowHeaderWidth="50px" MinutesPerRow="30" TimeLabelRowSpan="2"
                        FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" HoursPanelTimeFormat="HH:mm tt">
                        <DayView HeaderDateFormat="d" UserSelectable="true" />
                        <WeekView HeaderDateFormat="d" UserSelectable="true" />
                        <MonthView HeaderDateFormat="d" UserSelectable="true" />
                        <AgendaView HeaderDateFormat="d" UserSelectable="true" />
                        <TimelineView UserSelectable="false" />
                        <MultiDayView UserSelectable="false" />
                        <AdvancedForm Modal="true" />
                        <AppointmentTemplate>
                            <%# Container.Appointment.Resources.GetResourceByType("Type").Text%><br /><%# Eval("Subject") %><br /><%# Eval("Description") %>
                            <div>
                                <asp:Button runat="server" ID="BtnExport" CssClass="rsExportButton" ToolTip="Export to iCalendar" CommandName="Export" OnClientClick="Export(this, event); return false;" style="border: none; cursor: pointer;" />
                            </div>
                        </AppointmentTemplate>
                    </telerik:radscheduler>
    Code Behind:
    RadScheduler1.DataSource = DataSourceRadSchedular;


    Thanks in advance for your help.
  2. Answer
    Martin Gartmann
    Martin Gartmann avatar
    51 posts
    Member since:
    Apr 2004

    Posted 19 Apr Link to this post

    Hi ProgrammerNet,

    your code is not complete, so i attache a working example:

      <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="rcMain">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rsMain" UpdatePanelCssClass="" />
                        <telerik:AjaxUpdatedControl ControlID="rlStatus" UpdatePanelCssClass="" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
    <telerik:RadLabel ID="rlStatus" runat="server" BackColor="#3399FF" ForeColor="White" Width="725" Visible="False">Status Monitor</telerik:RadLabel>
        <telerik:RadScheduler ID="rsMain" runat="server" Culture="de-DE" DataDescriptionField="Description" DataEndField="End" DataKeyField="ID" DataSourceID="schedulerDataSet" DataStartField="Start" DataSubjectField="Summary" Height="650px" ShowFullTime="True" Skin="Bootstrap" FirstDayOfWeek="Monday" GroupBy="Spektrometer" LastDayOfWeek="Sunday" RowHeight="30px" TimeZoneID="W. Europe Standard Time" HoursPanelTimeFormat="HH:mmtt" MinutesPerRow="15" TimeZoneOffset="01:00:00">
            <ExportSettings>
                <Pdf PageTopMargin="1in" PageBottomMargin="1in" PageLeftMargin="1in" PageRightMargin="1in">
                </Pdf>
            </ExportSettings>
            <ResourceTypes>
                <telerik:ResourceType DataSourceID="dsResource" ForeignKeyField="ResourceID" KeyField="ID" Name="Spektrometer" TextField="Name" />
            </ResourceTypes>
        </telerik:RadScheduler>
     
        <asp:SqlDataSource ID="dsResource" runat="server" ConnectionString="<%$ ConnectionStrings:LIMS-CS %>" SelectCommand="SELECT * FROM [Resources]">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="schedulerDataSet" runat="server" ConnectionString="<%$ ConnectionStrings:LIMS-CS %>" SelectCommand="SELECT Appointments.*, AppointmentsResources.AppointmentID, AppointmentsResources.ResourceID, Resources.ID AS Expr1, Resources.Name, Resources.SystemColor FROM Appointments INNER JOIN AppointmentsResources ON Appointments.ID = AppointmentsResources.AppointmentID INNER JOIN Resources ON AppointmentsResources.ResourceID = Resources.ID" OldValuesParameterFormatString="original_{0}"></asp:SqlDataSource>
     
        </asp:Content>
            
    <asp:Content ID="Content3" ContentPlaceHolderID="cphNav" runat="server">
        <telerik:RadCalendar ID="rcMain" Runat="server" MultiViewRows="2" AutoPostBack="True" CssClass="RadCalendarMultiView RadCalendarMultiView_Default" Culture="de-DE" CultureInfo="de-DE" EnableMultiSelect="False" EnableWeekends="True" FastNavigationNextText="&lt;&lt;" SelectedDate="">
        </telerik:RadCalendar>
    </asp:Content>

    Most likely you missed the AJAX Manager.

    In the code it should look like this:

    Public 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 rcMain_SelectionChanged(sender As Object, e As Telerik.Web.UI.Calendar.SelectedDatesEventArgs) Handles rcMain.SelectionChanged
            rsMain.SelectedDate = rcMain.SelectedDate
            rlStatus.Text = rcMain.SelectedDate
        End Sub
    End Class

    Please not that this example starts from a masterpage.

    Kind Regards

    Martin

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top