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

[Solved] How to access updated resource values

2 Answers 139 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 26 Jan 2008, 01:18 PM
When an appt is updated from the Advanced Edit form, I want to access the modified resource values to see if any have changed, then do some work.  How can I do this?

I thought about getting the date out of the sqldatasource_updated handler, or perhaps the appointment_updated handler, but I'm not sure how to access the resources.

Thanks
Mark

2 Answers, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 28 Jan 2008, 02:39 PM
Hello Mark,

Please, try the following example:

aspx:
<telerik:RadScheduler ID="RadScheduler1" runat="server" ...> 
              <ResourceTypes> 
                <telerik:ResourceType DataSourceID="SqlDataSource2" Name="Rooms" ForeignKeyField="RoomID" KeyField="ID" TextField="RoomName" /> 
            </ResourceTypes> 
        </telerik:RadScheduler> 
     
        <asp:Label ID="OriginalAppointment" runat="server" Text="Label"></asp:Label> 
        <br /> 
        <br /> 
        <asp:Label ID="ModifiedAppointment" runat="server" Text="Label"></asp:Label> 

code-behind:
protected void RadScheduler1_AppointmentUpdate(object sender, Telerik.Web.UI.AppointmentUpdateEventArgs e)  
    {      
        OriginalAppointment.Text = "Text: " + e.Appointment.Resources.GetResourceByType("Rooms").Text + "; Key: " + e.Appointment.Resources.GetResourceByType("Rooms").Key.ToString();  
        ModifiedAppointment.Text = "Text: " + e.ModifiedAppointment.Resources.GetResourceByType("Rooms").Text + "; Key: " + e.ModifiedAppointment.Resources.GetResourceByType("Rooms").Key.ToString();  
    } 

The event argument of the AppointmentUpdate event exposes e.Appointment and e.ModifiedAppointment which you can use for this case.

Should you have any other questions, please, feel free to contact us.


Kind regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Mark
Top achievements
Rank 1
answered on 10 Feb 2008, 01:37 PM
Works great!
Tags
Scheduler
Asked by
Mark
Top achievements
Rank 1
Answers by
Peter
Telerik team
Mark
Top achievements
Rank 1
Share this question
or