Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Scheduler > customizing AdvancedEditTemplate takes too much time for form creating

Not answered customizing AdvancedEditTemplate takes too much time for form creating

Feed from this thread
  • dhamodharan Intermediate avatar

    Posted on Jan 25, 2012 (permalink)

    Hi,

    I am using radsheduler. and customizing advancedinsertTemplate and advancedEditTemplate. but the edit form creating it takes long time. i am using ajax. but when clikcing edit button the page has loaded. and masterpage loaded. after that form created. so it will take more than 12 seconds. but i want improve the performance. please let me know how to avoid masterpage load when form created.


    Thanks in Advance.
    Dhamu

    Reply

  • Peter Peter admin's avatar

    Posted on Jan 27, 2012 (permalink)

    Hi Dhamu,

    You can significantly improve performance if you use Web Service binding to populate RadScheduler. You can download a stand-alon sample from the code library.

    Greetings,
    Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

    Reply

  • dhamodharan Intermediate avatar

    Posted on Feb 6, 2012 (permalink)

    Hi Peter,

    I am using advancedinserttemplate. i am not able to using webservice with advancedInsertTemplate. please let me know ASAP.

    Thanks,
    Dhamu.

    Reply

  • dhamodharan Intermediate avatar

    Posted on Feb 8, 2012 (permalink)

    Hi, 

    Any idea. please it is very urgent. please let me know ASAP.


    Thanks,
    Dhamu

    Reply

  • Peter Peter admin's avatar

    Posted on Feb 8, 2012 (permalink)

    Hi,

    You can try the general top performance tips - http://www.telerik.com/products/aspnet-ajax/getting-started/top-performance.aspx.

    However, any irmprovement in performance using those tips would be negligible compared to what you would get using Web Service binding. I advise you to try to overcome the obstacles you have to using Web Service binding so that you can reap the performance benefits you would get with this mode.

    Greetings,
    Peter
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • dhamodharan Intermediate avatar

    Posted on Feb 8, 2012 (permalink)

    Hi,

    I just ask sample for how to create advancedInsertTemplate with wbservice binding,

    Please give a sample code for analyze.


    Thanks,
    Dhamu.

    Reply

  • Peter Peter admin's avatar

    Posted on Feb 13, 2012 (permalink)



    There is a sample in the code library entry I referred you to. There you will find a WebServiceBinding folder.

    Kind regards,
    Peter
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • dhamodharan Intermediate avatar

    Posted on Feb 20, 2012 (permalink)

    Hi Peter,

    I am using that code. but the appointment not display into scheduler. but the select query got record and return appointment but not display into scheduler. please check and let me know,

    Please check the code,

    aspx
    ------
    <telerik:RadScriptBlock ID="rsbScript" runat="server">   
        <script type="text/javascript">
            //<![CDATA[
            var categoryNames = new Array();

            function OnClientAppointmentsPopulating(sender, eventArgs) {
                //addSelectedCategoriesToArray(categoryNames);
                eventArgs.get_schedulerInfo().CategoryNames = categoryNames;
                categoryNames = new Array(); //clear the array
            }
          
            function OnClientAppointmentWebServiceInserting(sender, args) {
                //set a default Calendar resource
                if (args.get_appointment().get_resources().get_count() == 0) {
                    var defaultCalendarResource = sender.get_resources().getResourceByTypeAndKey("Calendar", 1);
                    args.get_appointment().get_resources().add(defaultCalendarResource);
                }
            }   

            function rebindScheduler() {
                var scheduler = $find('<%=RadScheduler1.ClientID %>');
                scheduler.rebind();
            }

            function onSchedulerDataBound(scheduler) {
                var $ = jQuery;
                $(".rsAptDelete").each(function () {
                    var apt = scheduler.getAppointmentFromDomElement(this);
                    // creating an object containing the data that should be applied on the template
                    var tmplValue = { Description: apt.get_description() };
                    // instantiate the template, populate it and insert before the delete handler (".rsAptDelete")
                    $("#tmplAppDescription").tmpl(tmplValue).insertBefore(this);
                });
            }
          
             //]]>
        </script>
        </telerik:RadScriptBlock>

    <form id="form1" runat="server">
         <telerik:RadScriptManager runat="server" ID="RadScriptManager1">
            <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" />
                <%--<asp:ScriptReference Path="Scripts/jquery.tmpl.js" />--%>
            </Scripts>
        </telerik:RadScriptManager>
        <div>
         <telerik:RadScheduler runat="server" ID="RadScheduler1" Skin="Windows7" Height="551px"
                        OnClientAppointmentWebServiceInserting="OnClientAppointmentWebServiceInserting"
                        OnClientAppointmentsPopulating="OnClientAppointmentsPopulating"
                        SelectedView="MonthView" ShowFooter="false" SelectedDate="2012-02-15" TimeZoneOffset="03:00:00"
                        DayStartTime="08:00:00" DayEndTime="21:00:00" FirstDayOfWeek="Monday" LastDayOfWeek="Friday"
                        EnableDescriptionField="true" AppointmentStyleMode="Default">
                        <WebServiceSettings Path="WebServiceScheduler.asmx" ResourcePopulationMode="ServerSide" />
                        <AdvancedForm Modal="true" />
                        <TimelineView UserSelectable="false" />                   
                        <TimeSlotContextMenuSettings EnableDefault="true" />
                        <AppointmentContextMenuSettings EnableDefault="true" />
                    </telerik:RadScheduler>
        </div>
         <telerik:RadAjaxLoadingPanel ID="ralpScheduler" Style="position: absolute" runat="server">
                </telerik:RadAjaxLoadingPanel>
        </form>

    webServiceScheduler.vb(webservice)
    Imports System.Collections.Generic
    Imports System.Web.Script.Services
    Imports System.Web.Services
    Imports Telerik.Web.UI
    Imports System.Data.Common

    ' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
    ' <System.Web.Script.Services.ScriptService()> _
    <WebService()> _
    <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
    <ScriptService()> _
    Public Class WebServiceScheduler
        Inherits System.Web.Services.WebService

        Private _controller As WebServiceAppointmentController

        ''' <summary>
        ''' The WebServiceAppointmentController class is used as a facade to the SchedulerProvider.
        ''' </summary>
        '''
        Private _provider As MyDbSchedulerProvider
        Private ReadOnly Property Provider() As MyDbSchedulerProvider
            Get
                If _provider Is Nothing Then
                    Dim connString = ConfigurationManager.ConnectionStrings("TelerikVSXConnectionString").ConnectionString
                    Dim factory = DbProviderFactories.GetFactory("System.Data.SqlClient")
                    _provider = New MyDbSchedulerProvider() With { _
                     .ConnectionString = connString, _
                     .DbFactory = factory, _
                     .PersistChanges = True _
                    }
                End If
                Return _provider
            End Get
        End Property
        Private ReadOnly Property Controller() As WebServiceAppointmentController      
            Get
                If _controller Is Nothing Then
                    _controller = New WebServiceAppointmentController(Provider)
                End If
                Return _controller
            End Get
        End Property

        <WebMethod()> _
        Public Function GetAppointments(ByVal schedulerInfo As SchedulerInfo) As IEnumerable(Of AppointmentData)
            Return Controller.GetAppointments(schedulerInfo)
        End Function

    Class File - App_code/MyDbSchedulerProvider.vb
    Imports Microsoft.VisualBasic
    Imports System
    Imports System.Collections.Generic
    Imports System.Data.Common
    Imports System.Data.SqlClient
    Imports Telerik.Web.UI

    Public Class MyDbSchedulerProvider

      Public Overrides Function GetAppointments(ByVal shedulerInfo As ISchedulerInfo) As IEnumerable(Of Appointment)
            Dim appointments As New List(Of Appointment)()

            Using conn As DbConnection = OpenConnection()
                Dim cmd As DbCommand = DbFactory.CreateCommand()
                cmd.Connection = conn
                cmd.CommandText = "SELECT [ClassID], [Subject], [Start], [End], [RecurrenceRule], [RecurrenceParentId], [Reminder], [Description], [AppointmentColor] FROM [DbProvider_Classes]"

                Using reader As DbDataReader = cmd.ExecuteReader()
                    While reader.Read()
                        Dim apt As New Appointment()
                        'apt.Owner = owner;
                        apt.ID = reader("ClassID")
                        apt.Subject = Convert.ToString(reader("Subject"))
                        apt.Description = Convert.ToString(reader("Description"))
                        apt.Attributes("AppointmentColor") = Convert.ToString(reader("AppointmentColor"))
                        apt.Start = DateTime.SpecifyKind(Convert.ToDateTime(reader("Start")), DateTimeKind.Utc)
                        apt.[End] = DateTime.SpecifyKind(Convert.ToDateTime(reader("End")), DateTimeKind.Utc)
                        apt.RecurrenceRule = Convert.ToString(reader("RecurrenceRule"))
                        apt.RecurrenceParentID = If(reader("RecurrenceParentId") Is DBNull.Value, Nothing, reader("RecurrenceParentId"))

                        If Not reader("Reminder") Is DBNull.Value Then
                            Dim reminders As IList(Of Reminder) = Reminder.TryParse(Convert.ToString(reader("Reminder")))
                            If reminders IsNot Nothing Then
                                apt.Reminders.AddRange(reminders)
                            End If
                        End If

                        If apt.RecurrenceParentID IsNot Nothing Then
                            apt.RecurrenceState = RecurrenceState.Exception
                        ElseIf apt.RecurrenceRule <> String.Empty Then
                            apt.RecurrenceState = RecurrenceState.Master
                        End If

                        'LoadResources(apt)
                        appointments.Add(apt)
                    End While
                End Using
            End Using

            Return appointments
        End Function
    End Class


    Thanks,
    Dhamu.

    Reply

  • Peter Peter admin's avatar

    Posted on Feb 22, 2012 (permalink)

    Hi,

    I have noticed that you have set SelectedDate="2012-02-15", so maybe there are no appointments for that day. Could you please try inserting new appointments and then refreshing the page to see if they persist?

    Regards,
    Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.

    Reply

  • dhamodharan Intermediate avatar

    Posted on Feb 23, 2012 (permalink)

    Hi Peter,

    I have record for this month SelectedDate="2012-02-15". i think it is not a problem. Please check my code and let me know.

    Thanks,
    Dhamu.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Scheduler > customizing AdvancedEditTemplate takes too much time for form creating
Related resources for "customizing AdvancedEditTemplate takes too much time for form creating"

ASP.NET Scheduler Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial ]