Customize AppointmentTemplate

5 posts, 0 answers
  1. Zeus_developer
    Zeus_developer avatar
    14 posts
    Member since:
    Jun 2006

    Posted 16 Jan 2012 Link to this post

    Hi,

    Please, I need a little help... 
    how could change the div background-color and include a Photo in a image tag?

    Please see the code below

    <AppointmentTemplate>
    <
    div style='background-color: <%# Eval("BackgroundColor")%>); height: 200px'>
    <img src='../uploads/avatars/<%# Eval("Photo") %>' style="height: 28px;float: left" alt='' />
        <%# Eval("Subject")%>
    </div>
    </AppointmentTemplate>

    Thanks
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 16 Jan 2012 Link to this post

    Hello,

    Take a look into the following documentation's AppointmentTemplate section.
    Templates


    Thanks,
    Princy.
  3. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 17 Jan 2012 Link to this post

    Hello,

    Also, the following online demo might be helpful - http://demos.telerik.com/aspnet-ajax/scheduler/examples/customizeappointment/defaultcs.aspx.

    All the best,
    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
  4. Zeus_developer
    Zeus_developer avatar
    14 posts
    Member since:
    Jun 2006

    Posted 17 Jan 2012 Link to this post

    Hi,

    thanks for your help, I solved this way:

    1.- I added custom attributes named Progress, Photo

    For change the color of the Appoinment:
    Protected Sub RadScheduler1_AppointmentDataBound(ByVal sender As Object, ByVal e As SchedulerEventArgs)
        If e.Appointment.Attributes("Progress") = 100 Then
            e.Appointment.BackColor = System.Drawing.Color.PaleGreen
        Else
            e.Appointment.BackColor = System.Drawing.Color.PaleVioletRed
        End If
    End Sub

    For assign the photo of the user:
    <img src='../uploads/avatars/<%# Eval("Photo")%>' style="height: 28px;float: left; margin: 0px 3px 0px 0px" alt='' />

    I hope this solution can help someone.

  5. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 18 Jan 2012 Link to this post

    Hi Segundo,

    Thank you for sharing your solution in the forum.

    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
Back to Top