Probably an easy question for somebody..
from event: RadScheduler2_AppointmentCreated
I am able to use e.Container.FindControl to get at my own asp:hidden cntrls inside an AppointmentTemplate
How can I get at those cntrls inside the event:
RadScheduler2_AppointmentInsert(object sender, SchedulerCancelEventArgs e)
Nice if there were an easier way to do this but basically I am making a db trip for every appointment and filling hiddens with extra data I would like to associate with the appointment. That way on the update or insert I can do my own ins/update to the db and add in those extra items. I take it the only other way to get the functionality I want would be to write my own provider??
Please at least answer the how to get at the hidden cntrls question above if you can.
Thanks.
from event: RadScheduler2_AppointmentCreated
I am able to use e.Container.FindControl to get at my own asp:hidden cntrls inside an AppointmentTemplate
How can I get at those cntrls inside the event:
RadScheduler2_AppointmentInsert(object sender, SchedulerCancelEventArgs e)
Nice if there were an easier way to do this but basically I am making a db trip for every appointment and filling hiddens with extra data I would like to associate with the appointment. That way on the update or insert I can do my own ins/update to the db and add in those extra items. I take it the only other way to get the functionality I want would be to write my own provider??
Please at least answer the how to get at the hidden cntrls question above if you can.
Thanks.
5 Answers, 1 is accepted
0
Wade Leveille
Top achievements
Rank 1
answered on 16 Feb 2008, 01:05 AM
I found this solution when I had the same problem. You should handle your updating and inserting in the event AppointmentCommand. Here's an example:
protected void RadScdler_AppointmentCommand(object sender, Telerik.Web.UI.AppointmentCommandEventArgs e)
{
if (e.CommandName == "Insert")
{
/* handle insert of event into database */
HiddenField hf = e.Container.FindControl("MyHiddenField") as HiddenField;
/***** Do DB Insert Here **********/
}
else if (e.CommandName == "Update")
{
/* handle update of event in database */
HiddenField hf = e.Container.FindControl("MyHiddenField") as HiddenField;
/***** Do DB Update Here **********/
}
}
0
Nate
Top achievements
Rank 1
answered on 19 Feb 2008, 05:14 PM
That would be nice but.. for example if I go into "week view" and then try to drag the appointment to lengthen the time span, the AppointmentCommand function is never fired.
RadScheduler2_AppointmentUpdate is actually what gets fired and I don't know how to get at my hidden controls from inside that function.
0
Hi Nathan,
You could use the FormCreated event:
I hope this helps.
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You could use the FormCreated event:
| protected void RadScheduler1_FormCreated(object sender, Telerik.Web.UI.SchedulerFormCreatedEventArgs e) |
| { |
| } |
I hope this helps.
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Nate
Top achievements
Rank 1
answered on 19 Feb 2008, 06:36 PM
Why would that work? Peter, please read my last post again. I don't think that your suggested function will even fire in that case.
0
Hi Nate,
I would recommend you to use Scheduler's Custom Attributes to associate additional data with appointments. You can see an example at http://www.telerik.com/demos/aspnet/prometheus/Scheduler/Examples/CustomAttributes/DefaultCS.aspx
Please, let us know if you this approach isn't suitable for your scenario.
Best wishes,
Dimitar Milushev
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I would recommend you to use Scheduler's Custom Attributes to associate additional data with appointments. You can see an example at http://www.telerik.com/demos/aspnet/prometheus/Scheduler/Examples/CustomAttributes/DefaultCS.aspx
Please, let us know if you this approach isn't suitable for your scenario.
Best wishes,
Dimitar Milushev
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center