I’m reevaluating your asp.net suit. First I must say it has improved a lot since last time and you seem to attend to all of my remarks back then.
Right now I’m testing the scheduler. I want to drag and drop from a grid, and open the insert form in the dropped place. Everything seems to work, except for the resources that seem to lose the selected information in the attributes fields.
I’ve being playing around with the demos and currently the code behind looks like this. The form is opened with the right subject and time, but the resources combos index are never selected:
protected void RadGrid1_RowDrop(object sender, GridDragDropEventArgs e)
{
GridDataItem dataItem = e.DraggedItems[0];
Hashtable values = new Hashtable();
dataItem.ExtractValues(values);
Int64 patId = (Int64)dataItem.GetDataKeyValue("ID"); // patient ID from grid
ViewState["PID"] = Convert.ToString(patId);
string fnm = (string)values["fnm"];
string lnm = (string)values["lnm"];
string subject = "New appointment for " + fnm + ' ' + lnm;
string targetSlotIndex = TargetSlotHiddenField.Value;
if (targetSlotIndex != string.Empty)
{
RadScheduler1.Rebind();
ISchedulerTimeSlot slot = RadScheduler1.GetTimeSlotFromIndex(targetSlotIndex);
TimeSpan duration = TimeSpan.FromHours(1);
if (slot.Duration == TimeSpan.FromDays(1))
{
duration = slot.Duration;
}
Appointment app = new Appointment();
app.Start = slot.Start;
app.End = slot.Start.Add(duration);
app.Subject = subject;
app.Attributes["PatientID"] = Convert.ToString(patId);
app.Attributes["PhysicianID"] = "1";
//RadScheduler1.InsertAppointment(app);
TargetSlotHiddenField.Value = string.Empty;
RadScheduler1.Rebind();
RadScheduler1.ShowAdvancedEditForm(app);
RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadGrid1, RadScheduler1);
}
}
protected
void RadScheduler1_AppointmentDelete(object sender, SchedulerCancelEventArgs e)
{
code written for delete
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
this.RadScheduler1.AppointmentInsert += new AppointmentInsertEventHandler(RadScheduler1_AppointmentInsert);
this.RadScheduler1.AppointmentDelete += new AppointmentDeleteEventHandler(RadScheduler1_AppointmentDelete);
this.RadScheduler1.AppointmentUpdate += new AppointmentUpdateEventHandler(RadScheduler1_AppointmentUpdate);
this.RadScheduler1.AppointmentCreated += new AppointmentCreatedEventHandler(RadScheduler1_AppointmentCreated);
}
override
protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
|