Interacting with custom controls in AppointmentTemplate

2 posts, 0 answers
  1. Matt
    Matt avatar
    29 posts
    Member since:
    Oct 2011

    Posted 22 Nov 2011 Link to this post

    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
  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 23 Nov 2011 Link to this post

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