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

[Solved] AdvancedEditTemplate question

2 Answers 141 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Rune
Top achievements
Rank 2
Rune asked on 06 Jul 2009, 01:23 PM
Hi,

I am investigating the AdvancedEditTemplate option. I need to be able to put a lot of custom fields on my appointment and when updating them run some C# code to get the information from the template and put it on my appointment.

My problem is that the examples I can find on this websites demos uses XML data providers or Session Data providers and are not very custom.

I have a custom SchedulerProvider wich at the moment handles the whole thing. But after creating an AdvancedEditTemplate I don't know how to access the data in the scheduler.

The question is simple, how do I access my controls in the AdvancedEditTemplate from my SchedulerProvider?

Regards
Rune

2 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 09 Jul 2009, 10:38 AM
Hi Rune,

All additional fields to the appointment should be set as Custom Attributes and binded in the template, for example:

<telerik:RadScheduler ID="RadScheduler1" runat="server"  
    ProviderName="XmlSchedulerProvider1" 
    CustomAttributeNames="Description"
    <AdvancedEditTemplate> 
        <asp:Label ID="Label1" runat="server" CssClass="inline-label">Description</asp:Label> 
        <asp:TextBox ID="SubjectTextBox" Rows="5" Columns="20" runat="server" Text='<%# Bind("Subject") %>' Width="95%" TextMode="MultiLine"></asp:TextBox> 
        <br /><br /><br /> 
        <asp:TextBox ID="DescriptionTextBox" runat="server" Text='<%# Bind("Description") %>' /> 
        <asp:LinkButton ID="InsertButton" runat="server" CommandName="Update">Insert</asp:LinkButton> 
        <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel">Cancel</asp:LinkButton> 
    </AdvancedEditTemplate> 
</telerik:RadScheduler> 


then they can be found in the Update method of the provider class as attributes ov the updated appointment:

foreach (string attribute in appointmentToUpdate.Attributes.Keys) 
   String attr = appointmentToUpdate.Attributes[attribute]; 

If you have any difficulties with this approach, please contact us again.

Regards,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Rune
Top achievements
Rank 2
answered on 09 Jul 2009, 11:48 AM
That is brilliant.

I will try it soon as possible!

Thankyou
Tags
Scheduler
Asked by
Rune
Top achievements
Rank 2
Answers by
Yana
Telerik team
Rune
Top achievements
Rank 2
Share this question
or