Add Appointments Programatically

2 posts, 0 answers
  1. Jugoslav
    Jugoslav avatar
    74 posts
    Member since:
    Mar 2011

    Posted 16 Sep 2011 Link to this post

    How do i add appointments from within code-behind. Something like the following:

    Dim startdate As DateTime = DateTime.Parse("9/16/2011")
            For i As Integer = 1 To 12
                startdate = startdate.AddMonths(1)
                ' pseudo code:

    Meaning, no source code (database, generic list etc. etc.). Just a simple loop.

    Thank you
  2. Ivana
    Ivana avatar
    657 posts

    Posted 19 Sep 2011 Link to this post

    Hello Jugoslav,

    I have answered to your question in the support ticket you have sent.
    For your convenience the answer to your question cold also be found here.

    In respect to your question:

    I have made an example for you showing how appointments could be added server-side.
    I have used a button that makes a post-back to the server and in its OnClick event handler I add appointments to the scheduler.

    Here is the example:
    Copy Code
    Protected Sub Button1_Click(sender As [Object], args As EventArgs)
        For counter As Integer = 1 To 3
            Dim start As DateTime = DateTime.Now.ToUniversalTime()
            start = start.AddHours(counter)
            Dim [end] As DateTime = start.AddHours(1)
            Dim apt As New Appointment(counter.ToString(), start, [end], "Subject of appointmenrt_" & counter.ToString())
    End Sub

    I hope this would help you.

    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
Back to Top