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

how to add one more form

1 Answer 68 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Dick Arlbring
Top achievements
Rank 1
Dick Arlbring asked on 28 Apr 2010, 11:16 AM
Hi
I'm using the advanced edit and advanced insert form, but I want to add one more form (not an inline form).
Is this possible?
It will be triggered from a contextmenu.

Kind Regrads
Dick

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 29 Apr 2010, 03:48 PM
Hello Dick,

Please, use the External Edit in RadDock demo as a starting point. Then using the Appointment context menu, handle OnAppointmentContextMenuItemClicking:

- set a flag (using viewstate or session) to keep track if the form was opened from a context menu
-set the ID of the right-clicked appointment using the EditedAppointmentID property:

protected object EditedAppointmentID
       {
           get { return ViewState["EditedAppointmentID"]; }
           set { ViewState["EditedAppointmentID"] = value; }
       }

- open the advanced form explicitly using the ShowAdvancedEditForm() method: 
RadScheduler1.ShowAdvancedEditForm(appointmentToEdit);


Then in FormCreating check the flag you set above and if it shows that the form is opened via the context menu proceed as in the example:

protected void RadScheduler1_FormCreating(object sender, SchedulerFormCreatingEventArgs e)
        {
            if (e.Mode == SchedulerFormMode.Insert || e.Mode == SchedulerFormMode.Edit)
            {
                EditedAppointmentID = e.Appointment.ID;
                e.Cancel = true;
  
                ScriptManager.RegisterStartupScript(Page, GetType(), "formScript", "Sys.Application.add_load(openForm);", true);
                PopulateEditForm(e.Appointment);
            }
        }



Greetings,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Scheduler
Asked by
Dick Arlbring
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or