Can someone show me (or direct me to) how to dynamically add a ResourceType?
I have tried the code below and I dont have the ResourceType available in the AppointmentCreated event
| ResourceType rt = new ResourceType(); |
| rt.DataSource = properties; |
| rt.ForeignKeyField = "PropertyId"; |
| rt.KeyField = "PropertyId"; |
| rt.Name = "Property"; |
| rt.TextField = "title"; |
| this.RadScheduler1.ResourceTypes.Add(rt); |
| protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e) |
| { |
| Resource prop = e.Appointment.Resources.GetResourceByType("Property"); |
| if (prop != null) |
| { |
| e.Appointment.CssClass = "ID" + prop.Key.ToString(); |
| } |
| } |
Do I need to populate the ResourceType at a particular point in the page life cycle?
This will tell me the property that is associated to the given appointment correct?
Thanks!