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

Interacting with custom controls in AppointmentTemplate

1 Answer 57 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 22 Nov 2011, 11:54 PM
I have customized my AppointmentTemplate by adding some controls (Labels and ImageButtons).
I need to access those controls to change values based on info I have in my Appointment object.
My first approach was just using Eval() to toggle the visibility of a LinkButton in the markup based on a custom attribute like this:
            <AppointmentTemplate>
                <p>
                    <h2><%# Eval("Subject") %></h2><br />
                </p>
                <p>
                    <h3><%# string.IsNullOrEmpty(Eval("Attributes['gst_name']").ToString().Trim()) ? "" : "with: " + Eval("Attributes['gst_name']") %></h3>
                </p>
                <p>
                     <asp:ImageButton id= "ibNotes" ImageUrl="~/Images/note.png" runat="server" CommandName="GetNote" Visible = "<%# Eval("Attributes['notelength']") = "0" ? "false" : "true" %>"/>

                </p>
                <p>
                    <h3>AppointmentTemplate<%# Eval("Attributes['modifiers']") %></h3>
                </p>
            </AppointmentTemplate>

But I can't build with it this way. I get an error: "The server tag is not well formed." Referring to my ImageButton location.

So I tried another approach, to get to it in codebehind, but I can't get anything working there either.
What server side event should I use? I'm thinking I'd need to use FindControl() but can't find anything in Intellisense.

Anyone got an example?

Thanks!

Matt

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 23 Nov 2011, 03:21 PM
Hello Matt,

I am not sure if you have seen the new demo on Customizing the Appointment. Probably, it can help you resolve the problem.

Let me know how it goes.

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
Tags
Scheduler
Asked by
Matt
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or