This is a migrated thread and some comments may be shown as answers.

Appointment Text

11 Answers 102 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Kerry
Top achievements
Rank 1
Kerry asked on 02 Dec 2013, 04:26 PM
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?

11 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 05 Dec 2013, 02:58 PM
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.
0
Kerry
Top achievements
Rank 1
answered on 05 Dec 2013, 03:14 PM
Not in the edit form. On the calendar. Please see the attached file.
0
Najid Hanif
Top achievements
Rank 2
answered on 05 Dec 2013, 07:16 PM
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!
0
Kerry
Top achievements
Rank 1
answered on 05 Dec 2013, 08:05 PM
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.
0
Najid Hanif
Top achievements
Rank 2
answered on 05 Dec 2013, 08:13 PM
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.
0
Kerry
Top achievements
Rank 1
answered on 05 Dec 2013, 08:24 PM
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.
0
Najid Hanif
Top achievements
Rank 2
answered on 05 Dec 2013, 08:44 PM
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.
0
Boyan Dimitrov
Telerik team
answered on 10 Dec 2013, 11:55 AM
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.
0
Kerry
Top achievements
Rank 1
answered on 18 Feb 2014, 03:41 PM
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
0
Accepted
Boyan Dimitrov
Telerik team
answered on 21 Feb 2014, 04:20 PM
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.
0
Kerry
Top achievements
Rank 1
answered on 24 Feb 2014, 05:09 PM
Excellent!

Thank you, Boyan! This solution worked perfectly!
Tags
Scheduler
Asked by
Kerry
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Kerry
Top achievements
Rank 1
Najid Hanif
Top achievements
Rank 2
Share this question
or