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

Displaying custom attributes in an appointment template

1 Answer 188 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Penny
Top achievements
Rank 1
Penny asked on 14 Aug 2008, 04:43 PM

I am trying to create an appointment template with an image and a hyperlink. I need the image and hyperlink URLs to be retrieved from custom attributes. I am currently using asp ImageButton and hyperlink controls to do this, but I am having trouble formatting the tags to retrieve the URLs.

My template is as follows:

<AppointmentTemplate>
<div>
<table id="mainTable" cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td width="20">
<asp:ImageButton runat="server" ID="detailsButton" ImageUrl=<%# Eval("Attributes['DetailsIconURL']") %>
AlternateText='Show Details' />
</td>
<td>
<asp:HyperLink ID='LinkButton' Font-Underline="true" ToolTip=<%# Eval("Attributes['ToolTip']") %> NavigateUrl=<%# Eval("Attributes['NavigateURL']") %>
Font-Name="Arial" runat="server" Font-Size="8pt" Font-Names="Arial,Tahoma,Verdana" Text='<%# Bind("Subject")%>'>
</asp:HyperLink>
</td>
</tr>
</table>
</div>
</AppointmentTemplate>

2 questions:

1. How do I define and set custom attributes in codebehind?

2. How do I assign the custom attribute values (URLs in this case) to control attributes in asp control tags?

1 Answer, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 15 Aug 2008, 04:15 PM
Hi Penny,

Please review our online example: Custom Attributes.

You should set the CustomAttributeNames property to point to the corresponding columns from your data source - for example: CustomAttributeNames = "NavigateURL".

Note that you should have a column with name "NavigateURL" in the table you are using for appointments.


Regards,
Helen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
Penny
Top achievements
Rank 1
Answers by
Helen
Telerik team
Share this question
or