RadScheduler no record is shown from sql database

2 posts, 0 answers
  1. Chris
    Chris avatar
    1 posts
    Member since:
    Dec 2018

    Posted 06 Dec 2018 Link to this post

    Hi

     

    I have followed the guide to create a simple project with RadScheduler with vs 2010.

    In the project, the RadScheduler retrieves the record from sql database.

    However, after I start the website,

    1. no appointment option is shown up after double-click any cells.

    2. no event is shown in the scheduler. (the record is exist in sql database and tested ok for the connection)

     

    What do I miss?

    Below is my code:

     

    <%@ Page Language="VB" AutoEventWireup="true" CodeFile="RadSchedulerWebForm.aspx.vb" Inherits="RadSchedulerWebForm" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
        <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
    </head>
    <body>
        <form id="form1" runat="server">
        <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" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //Put your JavaScript code here.
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadScheduler runat="server" ID="RadScheduler1" DataEndField="EndTime"
            DataKeyField="id" DataSourceID="SqlDataSource1" DataStartField="StartTime"
            ReadOnly="True" StartEditingInAdvancedForm="false"
            DataSubjectField="Subject">         
        </telerik:RadScheduler>
     
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:Scheduler_TestConnectionString %>"
            DeleteCommand="DELETE FROM [scheduler_table] WHERE [id] = @id"
            InsertCommand="INSERT INTO [scheduler_table] ([id], [Subject], [StartTime], [EndTime]) VALUES (@id, @Subject, @StartTime, @EndTime)"
            SelectCommand="SELECT * FROM [scheduler_table]"
             
             
            UpdateCommand="UPDATE [scheduler_table] SET [Subject] = @Subject, [StartTime] = @StartTime, [EndTime] = @EndTime WHERE [id] = @id">
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="id" Type="Int32" />
                <asp:Parameter Name="Subject" Type="String" />
                <asp:Parameter Name="StartTime" Type="DateTime" />
                <asp:Parameter Name="EndTime" Type="DateTime" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="Subject" Type="String" />
                <asp:Parameter Name="StartTime" Type="DateTime" />
                <asp:Parameter Name="EndTime" Type="DateTime" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
        </form>
    </body>
    </html>
  2. Peter Milchev
    Admin
    Peter Milchev avatar
    467 posts

    Posted 11 Dec 2018 Link to this post

    Hello Chris,

    Would you please try setting the ReadOnly property to false so that you can insert an appointment via the built-in forms and check if it will be inserted and visualized correctly? 

    Also, please ensure the appointments you have in the datasource are in the Visible range of the Scheduler. When the SelectedDate is not explicitly set for the RadScheduler, the default value for this property is used, which is equal to DateTime.Now.

    For your convenience, I have attached a sample runnable project that has an implementation similar to the provided one and works as expected.

    Meanwhile, you can check for any JavaScript errors in the browser console that might prevent the proper behavior of the control.

    Regards,
    Peter Milchev
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top