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

[Solved] 'Edit Template' in a new form

7 Answers 154 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
antonio
Top achievements
Rank 1
antonio asked on 28 May 2008, 02:20 PM
Hello,

I wonder if it's possible to launch the edit/insert form (after double-clicking on the scheduler) in a new form.  The default behavior shows it in the same form after a psot-back, and this creates problems with our implementation of AJAX.

Any help would be appreciated.

Thanks.

7 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 29 May 2008, 08:03 AM
Hi antonio,

Have you seen the External Edit in RadWindow example? Is this what you need?


Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
antonio
Top achievements
Rank 1
answered on 29 May 2008, 01:48 PM
Hello Peter,

Yes, I've seen the example but it loses the functionality to handle recurrent appointments.  We also tried 'Customizing the Advance Template' but couldn't make it work since we use a custom data source.

Since we use MS AJAX (not Telerik's implementation), I think that the server events for our custome data source (like Insert, Update, etc) are being ignored.

Thanks.
0
Peter
Telerik team
answered on 30 May 2008, 12:38 PM
Hi Antonio,

Using the Customizing the Advanced Template example is indeed the best way to handle this scenario. Without a test project or sample code, I cannot say why the server events for your custom data source are being ignored. I assume you have followed the Implementing A Provider topic.

Also, I suggest you exclude the MS AJAX and test your application without it. This will help us rule out or confirm the possibility that the MS AJAX is interfering with your custom provider.


Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
antonio
Top achievements
Rank 1
answered on 30 May 2008, 01:37 PM
Hello Peter,

Yes I have followed the instructions as to how to create a Provider.  In fact, it loads existing data just fine, and even the drag-and-drop raises the 'update' event.  However, when the editing form is displayed, then the 'insert' event never executes.

Unfortunately, I can't turn off MS AJAX because this is running in an application that generates the HTML code dynamically, so I don't have much control on that.  I wonder if it's possible to surround the RadScheduler control in an <asp:UpdatePanel>.  So far, I have tried that but it gives a syntax error.

Thanks,

Antonio
0
antonio
Top achievements
Rank 1
answered on 30 May 2008, 01:49 PM
Hello Peter,

As you requested, here's the code for our implementation:

We defined the custome datasource as follows:
(This is in Page_Load)

MyDbSchedulerProvider schedulerProvider = new MyDbSchedulerProvider();

RadScheduler1.Provider = schedulerProvider;

RadScheduler1.Rebind();


Here is the code for MyDbSchedulerProvider:

public

class MyDbSchedulerProvider : DbSchedulerProviderBase

{

public override void Delete(RadScheduler owner, Appointment appointmentToDelete)

{

throw new System.Exception("The method or operation is not implemented.");

}

// loading appointments

public override IEnumerable<Appointment> GetAppointments(RadScheduler owner)

{

List<Appointment> appointments = new List<Appointment>();

Database db = Harmony.Data.DataFactoryBase.GetHarmonyDatabase();

DBCommandWrapper dbCommandWrapper = db.GetStoredProcCommandWrapper("p_WH_AppointmentListFetch");

dbCommandWrapper.AddInParameter(

"CaseNo", DbType.Int64, ContextInfo.Current.ChapterEntityID);

dbCommandWrapper.AddInParameter(

"UserID", DbType.Int32, UserSessionData.Current.UserID);

dbCommandWrapper.AddInParameter(

"RoleID", DbType.Int32, UserSessionData.Current.RoleID);

dbCommandWrapper.AddInParameter(

"DynamicSQL", DbType.AnsiString, "");

dbCommandWrapper.AddInParameter(

"PageNumber", DbType.Int32, 1);

dbCommandWrapper.AddInParameter(

"PageSize", DbType.Int32, 1000);

dbCommandWrapper.AddInParameter(

"SortExpression", DbType.AnsiString, "");

dbCommandWrapper.AddInParameter(

"SortOrder", DbType.AnsiString, "");

DataSet dsAppointments = db.ExecuteDataSet(dbCommandWrapper);

if (dsAppointments != null)

{

foreach (DataRow dr in dsAppointments.Tables[0].Rows)

{

Appointment apt = new Appointment();

apt.Owner = owner;

apt.ID = dr[

"EntityID"];

apt.Subject =

Convert.ToString(dr["Description"]);

apt.Start =

Convert.ToDateTime(dr["StartDate"]);

apt.End =

Convert.ToDateTime(dr["EndDate"]);

// since this is a proof of concept we'll use existing fields rather than modifying the structure

apt.RecurrenceRule =

Convert.ToString(dr["ApptGenericText2"]);

apt.RecurrenceParentID = dr[

"TeamId"] == DBNull.Value ? null : dr["TeamId"];

if (apt.RecurrenceParentID != null)

{

apt.RecurrenceState =

RecurrenceState.Exception;

}

else if (apt.RecurrenceRule != string.Empty)

{

apt.RecurrenceState =

RecurrenceState.Master;

}

LoadResources(apt);

appointments.Add(apt);

}

}

return appointments;

}

-------------------------------------

We are not using Telerik's RadAjaxManager or RadAjaxPanel because we already implement MS AJAX, and it certainly cannot intercept any events from your advanced-template.
As I mentioned before, the drag-and-drop does fire the 'update' event but the 'insert' button in your advanced-template does not do anything.

Thanks.
0
Peter
Telerik team
answered on 03 Jun 2008, 03:56 AM
Hi antonio,

Everything looks alright with your provider. The problem seems to be the call to Rebind() in Page_Load. Removing it should resolve the issue.


Kind regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
antonio
Top achievements
Rank 1
answered on 04 Jun 2008, 10:32 PM
That worked.

Thanks
Tags
Scheduler
Asked by
antonio
Top achievements
Rank 1
Answers by
Peter
Telerik team
antonio
Top achievements
Rank 1
Share this question
or