Appointment Text

12 posts, 1 answers
  1. Kerry
    Kerry avatar
    25 posts
    Member since:
    Jun 2013

    Posted 02 Dec 2013 Link to this post

    Is there a way to modify the text that is displayed on the appointment block?

    In my situation, I have my own custom Appointment object that has all the required fields, plus several other custom fields. The datasource for the scheduler is a custom collection of these objects.

    In my appointment block, I want to display the Subject (required field) along with its associated location (custom field). Is this possible?
  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 05 Dec 2013 Link to this post

    Hello,

    Thank you for contacting Telerik Support.

    As far as I understand you want to show additional text field in your advanced insert/edit form. An easy and convenient way of achieving such functionality would be using RadScheduler CustomAttributeNames collection. By setting EnableCustomAttributeEditing to "true" all your custom attributes will be shown as text fields in your advanced form. For more information please review the following demo.

    Hope that this will be helpful.

    Regards,
    Boyan Dimitrov
    Telerik
    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 the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kerry
    Kerry avatar
    25 posts
    Member since:
    Jun 2013

    Posted 05 Dec 2013 Link to this post

    Not in the edit form. On the calendar. Please see the attached file.
  5. Najid Hanif
    Najid Hanif avatar
    92 posts
    Member since:
    Jul 2011

    Posted 05 Dec 2013 Link to this post

    Hi - You need to use a template, something like:

    <telerik:RadScheduler ID="RadScheduler1" runat="server" 
                          DataEndField="DeploymentDateEnd" 
                          DataKeyField="ID" DataSourceID="SqlDataSource_Calendar"
                                  CustomAttributeNames="DeploymentTypeID, ExtraInfo, URL"
                          DataStartField="DeploymentDateStart" DataSubjectField="Application">

        <AppointmentTemplate>
            <div>
                <div>
                    <strong><%#Eval("URL") %></strong>
                </div>
            <%#Eval("ExtraInfo")%>
            </div>
        </AppointmentTemplate>
    </telerik:RadScheduler>

    Add in the cols you want from your datasource in the section CustomAttributeNames 

    Hope this helps!
  6. Kerry
    Kerry avatar
    25 posts
    Member since:
    Jun 2013

    Posted 05 Dec 2013 Link to this post

    This doesn't quite work. I still get "DataBinding: 'Telerik.Web.UI.Appointment' does not contain a property with the name X" error.

    My custom appointment object has a custom AssignedTask object that contains the location info I wish to display.

    I have added CustomAttributeNames="AssignedTask.LocationInfo", but that doesn't work.

    Here is the template

    <AppointmentTemplate>
        <%#Eval("Subject")%> - <%#Eval("AssignedTask.LinkedLocationName")%>
    </AppointmentTemplate>

    The Subject works just fine, but I get an error on the second field. The datasource is being cast into a Telerik Appointment class, so these extra fields do not exist.
  7. Najid Hanif
    Najid Hanif avatar
    92 posts
    Member since:
    Jul 2011

    Posted 05 Dec 2013 Link to this post

    You have 2 different field names  CustomAttributeNames="AssignedTask.LocationInfo",  <%#Eval("AssignedTask.LinkedLocationName")%>

    Also if AssignedTask is your table name you probably have to leave that out.
  8. Kerry
    Kerry avatar
    25 posts
    Member since:
    Jun 2013

    Posted 05 Dec 2013 Link to this post

    Thank you very much for responding so quickly!

    My mistake there. The field name was just a mistype and is correctly named in my code.

    AssignedTask is not a table, it is a property of my custom Appointment object. That property is of a custom class. That custom class has a property named LinkedLocationName. So, what I have is this:

    CustomAppointment (class)
    Property: Subject (String)
    Property: AssignedTask (CustomAssignedTask)

    CustomAssignedTask (class)
    Property: LinkedLocationName (String)

    I need to display this LinkedLocationName in the appointment block.

    Inconsequently, the page renders without issue if I leave the "AssignedTask" identifier out, but it does not pull the data from the underlying object.
  9. Najid Hanif
    Najid Hanif avatar
    92 posts
    Member since:
    Jul 2011

    Posted 05 Dec 2013 Link to this post

    I see. The code I posted is working with a SqlDataSource. Sorry, I don't know how to help you with the way your doing it now. Hopefully someone from Telerik can shed some light on it for you.
  10. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 10 Dec 2013 Link to this post

    Hello,

    Please find attached sample project that shows an easy and convenient way of printing a custom appointment property value to the appointment template. In the provided sample the property UserID is part of the AppointmentInfo class. This property is added as custom attribute to the appointment object (please take a look at the AppointmentDataBound event handler).


    Regards,
    Boyan Dimitrov
    Telerik
    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 the blog feed now.
  11. Kerry
    Kerry avatar
    25 posts
    Member since:
    Jun 2013

    Posted 18 Feb 2014 in reply to Boyan Dimitrov Link to this post

    Unfortunately, that solution STILL does not help. All the properties of your AppointmentInfo class are discreet types. I have no issue pulling my own custom properties directly off the appointment. One of the properties of MY appointment is another custom class, which subsequently contains the property I actually want to display.

    I ended up just adding a property to my top level class that pulls the data I need from it's property class.

    CustomAssignedTask (class)
    Property: LinkedLocationName (string)

    CustomAppointment (class)
    Property: Subject (string)
    Property: LocationName (string, read-only) = CustomAssignedTask.LinkedLocationName
  12. Answer
    Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 21 Feb 2014 Link to this post

    Hello,

    Please find attached a sample project that has a custom class for a appointment property. The value of that custom property is printed on the appointment element concatenated with the appointment subject.

    Regards,
    Boyan Dimitrov
    Telerik
    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 UI for ASP.NET AJAX, subscribe to the blog feed now.
  13. Kerry
    Kerry avatar
    25 posts
    Member since:
    Jun 2013

    Posted 24 Feb 2014 Link to this post

    Excellent!

    Thank you, Boyan! This solution worked perfectly!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017