Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Scheduler and Reminder > Edit Appointment Dialogue

Not answered Edit Appointment Dialogue

Feed from this thread
  • DGraham avatar

    Posted on Mar 3, 2009 (permalink)

    Hi,

    Is it posssible to add additional controls such as a radCheckbox to the 'editAppointmentsDialouge'?
    I need to implement a way of marking appointments as confirmed/not yet confirmed.

    Regards

    Dave

    Reply

  • Jordan Jordan admin's avatar

    Posted on Mar 4, 2009 (permalink)

    Hi Dave Palmer,

    Yes, it is possible. We will most probably have such an example very soon.

    To do that you must do the following:

    1. Inherit the default form (EditAppointmentDialog) and do your customization (you can even use the winforms designer for that).

    public partial class CustomAppointmentEditDialog : EditAppointmentDialog 
        { 
            private RadComboBox cmbShowTimeAs = null
     
            public CustomAppointmentEditDialog() 
            { 
                InitializeComponent(); 
     
                this.cmbShowTimeAs = this.Controls["cmbShowTimeAs"as RadComboBox; 
            } 
     
            private void chkConfirmed_ToggleStateChanged(object sender, StateChangedEventArgs args) 
            { 
                this.cmbShowTimeAs.SelectedValue = (args.ToggleState == ToggleState.On) ? 
                    (int)AppointmentStatus.Busy : (int)AppointmentStatus.Tentative; 
            } 
        } 


    In the above code I have added an additional check box and set the status (show time as) of the appointment to Tentative if it is unchecked or to Busy if it is checked. The strange way of accessing the combo box is because it is private currently. This will be changed for the upcoming Q1 2009 release.

    2. Subscribe to AppointmentEditDialogShowing event of RadScheduler and substitute the default form with your customized one:

    private IEditAppointmentDialog appointmentEditDialog = null
     
            protected override void OnLoad(EventArgs e) 
            { 
                base.OnLoad(e); 
     
                this.radScheduler1.AppointmentEditDialogShowing += new EventHandler<AppointmentEditDialogShowingEventArgs>(radScheduler1_AppointmentEditDialogShowing); 
            } 
     
            void radScheduler1_AppointmentEditDialogShowing(object sender, Telerik.WinControls.UI.AppointmentEditDialogShowingEventArgs e) 
            { 
                if (this.appointmentEditDialog == null
                { 
                    this.appointmentEditDialog = new CustomAppointmentEditDialog(); 
                } 
                e.AppointmentEditDialog = this.appointmentEditDialog; 
            } 

    I hope this helps. Do not hesitate to write me back if you have further questions.

    Regards,
    Jordan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

    Reply

  • Praveen Rustagi avatar

    Posted on May 12, 2009 (permalink)

    How can i change the title of Edit Appointment Dialogue? Currently it is showing "Edit Appointment".

    Reply

  • Jordan Jordan admin's avatar

    Posted on May 14, 2009 (permalink)

    Hi Praveen Rustagi,

    If the text that you want to change the title to is not defendant on the edited appointment, you do not need to subclass the appointment edit dialog. You can use a very simple localization provider like bellow:
     
    protected override void OnLoad(EventArgs e) 
            { 
                base.OnLoad(e); 
     
                RadSchedulerLocalizationProvider.CurrentProvider = new CustomSchedulerLocalizationProvider(); 
            } 
     
            public class CustomSchedulerLocalizationProvider : RadSchedulerLocalizationProvider 
            { 
                public override string GetLocalizedString(string id) 
                { 
                    if (id == RadSchedulerStringId.AppointmentDialogTitle) 
                    { 
                        return "Custom appointment dialog"
                    } 
                    return base.GetLocalizedString(id); 
                } 
            } 

    However if the text depends on the appointment being edited, you will need to subclass the appointment edit dialog (see the code sample earlier in the same thread) and set the Text property in some overridden method.

    Do not hesitate to write again if you have more questions or suggestions.

    Regards,
    Jordan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

    Reply

  • Posted on Jun 30, 2009 (permalink)

    Is this possible in VB?

    Can't seem to find Telerik.WinControls.UI.EditAppointmentDialog when using VB.NET

    Reply

  • Jordan Jordan admin's avatar

    Posted on Jul 3, 2009 (permalink)

    Hi kultman,

    Yes, all things in this thread should be possible with VB.NET also. However, you will not be able to find the EditAppointmentDialog in the Telerik.WinControls.UI namespace (or at least you should not). It is in the Telerik.WinControls.UI.Scheduler.Dialogs namespace.

    Did you read that this dialog is in that namespace in some help or KB article? If so, could you share with us which is it , so we can fix it?

    Best wishes,
    Jordan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

    Reply

  • Steven Steven avatar

    Posted on Jul 31, 2009 (permalink)

    I'd like to create my own custom EditAppointments form.  In your example and in the forum's members have described how to do it by inheriting the base form.  This proves to not be viable as those controls are locked and I'm unable to delete them.  I wanted to create my own form with unique fields.  Is there an example of how to call a unique Edit Appointments form and build it from scratch?

    I"ve got:
    private void radScheduler1_AppointmentEditDialogShowing1(object sender, Telerik.WinControls.UI.AppointmentEditDialogShowingEventArgs e)
            {
                if (this.appointmentEditDialog == null)
                {
                    this.appointmentEditDialog = new CustomAppointment();
                }
                e.AppointmentEditDialog = this.appointmentEditDialog;
            }
    But I can't seem to get this to work if I'm not inheriting the EditAppointmentDialog and if I do inherit, it will lock the original controls.

    Thanks!

    Reply

  • Jordan Jordan admin's avatar

    Posted on Aug 4, 2009 (permalink)

    Hello Steven,

    Basically in order to make a completely new implementation of an appointment edit dialog you have to implement the IEditAppointmentDialog interface from scratch. But if you are assigning it to e.AppointmentEditDialog you have probably already done that. As I explained in this forum post it may not be a trivial task. It is also not clear what is not working in your current implementation. Could you elaborate more on that? If we know what exactly is not working we could suggest how it can be fixed.

    And finally, regarding inheriting from the default appointment edit dialog, I am not sure if this will work for you, but you could try hiding (instead of deleting) the controls that you do not want.

    Sincerely yours,
    Jordan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

    Reply

  • Steven Steven avatar

    Posted on Aug 5, 2009 (permalink)

    Hi Jordan, thanks for the reply. I'm working on an appointment scheduler for a tanning salon.  Basically the user will be able to select a piece of equipment they would like to schedule with, it would load the free/busy time in the calendar for that specific equipment.  Depending on the equipment it would have a pre-determined appt. duration ie 20 min for one, 25 min for another.  This would automatically show up in the appt dialog based on what they click on.  The Appt. edit dialog would consist mainly of the Start Time, uneditable duration, their name which gets automatically put in since they logged in earlier, and a spot for notes if necessary.  I figured just hiding most of the current options would be easiest, but then it would be most of them and I wasn't sure how to hide the labels as they are locked after inheriting the appointmenteditdialog.  I wasn't sure how to reference for instance lblEndTime.visible = false;

    Thanks again.

    Steve

    Reply

  • Tiago avatar

    Posted on Aug 6, 2009 (permalink)

    Hi,
    In the following code:

    public partial class CustomAppointmentEditDialog : EditAppointmentDialog 
        { 
            private RadComboBox cmbShowTimeAs = null
     
            public CustomAppointmentEditDialog() 
            { 
                InitializeComponent(); 
     
                this.cmbShowTimeAs = this.Controls["cmbShowTimeAs"as RadComboBox; 
            } 
     
            private void chkConfirmed_ToggleStateChanged(object sender, StateChangedEventArgs args) 
            { 
                this.cmbShowTimeAs.SelectedValue = (args.ToggleState == ToggleState.On) ? 
                    (int)AppointmentStatus.Busy : (int)AppointmentStatus.Tentative; 
            } 
        } 

    I get this errors:
    Warning 1 'CRMOS.CustomAppointmentEditDialog.cmbShowTimeAs' hides inherited member 'Telerik.WinControls.UI.Scheduler.Dialogs.EditAppointmentDialog.cmbShowTimeAs'. Use the new keyword if hiding was intended. C:\Users\Tiago\Documents\Visual Studio 2008\Projects\CRMOS\CRMOS\CustomAppointmentEditDialog.cs 13 29 CRMOS
    Error 2 The name 'InitializeComponent' does not exist in the current context C:\Users\Tiago\Documents\Visual Studio 2008\Projects\CRMOS\CRMOS\CustomAppointmentEditDialog.cs 17 13 CRMOS
    Error 3 The name 'ToggleState' does not exist in the current context C:\Users\Tiago\Documents\Visual Studio 2008\Projects\CRMOS\CRMOS\CustomAppointmentEditDialog.cs 24 69 CRMOS

    Can you help?

    Thanks,
    Tiago

    Reply

  • Tiago avatar

    Posted on Aug 6, 2009 (permalink)

    Dear friends,

    My problem is solved!! Insted of doing that ... i simple inherit the EditAppointmentDialog and used the form designer to make all changes.

    Many thanks!!

    Reply

  • Jordan Jordan admin's avatar

    Posted on Aug 7, 2009 (permalink)

    Hello Steve,

    Currently the labels are private and the edit controls are protected. You can access any of the labels by name as in the sample below. You will also need to override the LoadSettingsFromEvent method of the EditAppointmentDialog in order to override the settings of the end time controls:

    protected override void LoadSettingsFromEvent(IEvent ev) 
            { 
                base.LoadSettingsFromEvent(ev); 
     
                this.dateEnd.Visible = false
                this.timeEnd.Visible = false
                this.Controls["lblEndTime"].Visible = false
            } 

    All the best,
    Jordan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

    Reply

  • Steven Steven avatar

    Posted on Aug 11, 2009 (permalink)

    Great, I've got most of it all built and functioning.  The custom form is loaded and integrates with my custom fields in the data source.  However after clicking the save button within the Edit Appointment Dialogue it throws this error, "cannot clear list."  Any ideas?

    A first chance exception of type 'System.ArgumentException' occurred in System.Data.dll
    ERROR: System.ArgumentException: Cannot clear this list.
       at System.Data.DataView.System.Collections.IList.Clear()
       at Telerik.WinControls.UI.Scheduler.SimpleResourceIdMapper.ClearResourceIds()
       at Telerik.WinControls.UI.SchedulerBindingDataSource.EventBindingProvider.ProcessSchedulerItem(IEvent schedulerItem, Object dataSourceItem, SchedulerMapping mapping, PropertyDescriptor dataItemProperty)
       at Telerik.WinControls.UI.Scheduler.BindingProviderBase`1.UpdateDataItemProperties(Object item, T schedulerItem)
       at Telerik.WinControls.UI.Scheduler.BindingProviderBase`1.Insert(T itemToInsert)
       at Telerik.WinControls.UI.RadScheduler.OnAddAppointments(IList list)
       at Telerik.WinControls.UI.RadScheduler.appointments_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
       at Telerik.WinControls.Data.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       at Telerik.WinControls.Data.ObservableCollection`1.NotifyListenersCollectionChanged(NotifyCollectionChangedEventArgs e)
       at Telerik.WinControls.Data.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
       at Telerik.WinControls.Data.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedAction action, Object item, Int32 index)
       at Telerik.WinControls.Data.ObservableCollection`1.InsertItem(Int32 index, T item, Action`1 approvedAction)
       at Telerik.WinControls.Data.ObservableCollection`1.InsertItem(Int32 index, T item)
       at Telerik.WinControls.UI.SchedulerAppointmentCollection.InsertItem(Int32 index, IEvent item)
       at System.Collections.ObjectModel.Collection`1.Add(T item)
       at Telerik.WinControls.UI.DayViewAppointmentsTable.cell_DoubleClick(Object sender, EventArgs e)
       at Telerik.WinControls.RadItem.OnDoubleClick(EventArgs e)
       at Telerik.WinControls.RadItem.DoDoubleClick(EventArgs e)
       at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e)
       at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
       at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
       at Telerik.WinControls.UI.RadScheduler.OnMouseUp(MouseEventArgs e)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at Telerik.WinControls.RadControl.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at WindowsFormsApplication11.Program.Main() in C:\Users\theone\Documents\Visual Studio 2008\Projects\WindowsFormsApplication11\WindowsFormsApplication11\Program.cs:line 21
    The thread 0x1358 has exited with code 0 (0x0).
    The thread 0x12f0 has exited with code 0 (0x0).
    The program '[5008] WindowsFormsApplication11.vshost.exe: Managed' has exited with code 0 (0x0).

    Reply

  • Jordan Jordan admin's avatar

    Posted on Aug 12, 2009 (permalink)

    Hi Steven Steven,

    I will need to take a look at your data objects that you bind to RadScheduler in order to be sure what really happens. But it seems that the list property of the appointment that contains the resource ids cannot be cleared (for some reason its Clear method is implemented to throw an exception).

    If this does not help it will be best if you can send a sample project that reproduces the issue. If you cannot for some reason send a project I will need at least the code for your data objects.

    All the best,
    Jordan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

    Reply

  • Ramiro avatar

    Posted on Sep 16, 2009 (permalink)

    Hi,

       Please, tell me How can I move or change the name of the elements that are blocked in the form inherited Edit Appointment ??


    Thank you
    Ramiro

    Reply

  • Jordan Jordan admin's avatar

    Posted on Sep 22, 2009 (permalink)

    Hello Ramiro,

    Do I understand correctly that by "blocked" you mean the private elements in the edit appointment dialog form, like the labels?
    You can access those elements / controls by name using the Controls collection, like bellow:

    this.Controls["lblEndTime"].Visible = false;

    You can find the complete sample earlier in this thread.
    Also, if you only need to change the texts of the labels you can do that even without creating an inherited form using a localization provider (again, see earlier in this thread).

    Kind regards,
    Jordan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

    Reply

  • Ramiro avatar

    Posted on Sep 23, 2009 (permalink)

    Hi, thank you for the explication, it was very exact and it help me with my proyect.

    thank you again.

    Reply

  • Will H avatar

    Posted on Oct 16, 2009 (permalink)

    Edit: Im using VS2008 VB.net (C# is not an option at this point or i would have been done days ago)
    I am using RadScheduler and i want to add some options to it (such as client being booked, ane employee being booked. I have successfully inherited the edit appointments form, i think, but its empty. No controls are on the form.

    Can someone demonstrate how to edit the default "edit appointment dialog" to add a couple of controls to it? I would really appreciate it.

    Thank you
    -AC

    Reply

  • Jordan Jordan admin's avatar

    Posted on Oct 21, 2009 (permalink)

    Hello Will H,

    Please see the response to your question in this forum thread:
    http://www.telerik.com/community/forums/winforms/scheduler/how-to-change-the-quot-edit-appointment-dialog-windows-quot-labels-and-dropdownlist-value.aspx

    Sincerely yours,
    Jordan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

    Reply

  • Posted on Dec 20, 2009 (permalink)

    Hi,
      how it is possible to get specific start and end time, when i click on a cell and use CustomAppointmentEditDialog. I meant my CustomAppointmentEditDialog does not fill in with a information from scheduler.

    Reply

  • Boyko Markov Boyko Markov admin's avatar

    Posted on Dec 24, 2009 (permalink)

    Hello javas,

    If you want to get the selection's start date and end date which are used to populate the RadScheduler dialog, then you can do the following:

    1. Subscribe to the AppointmentEditDialogShowing event.
    2. In the event handler, you need to iterate through the cells and then save the start and end date from the selected cells.

    void radScheduler_AppointmentEditDialogShowing(object sender, AppointmentEditDialogShowingEventArgs e)
            {
                SchedulerDayViewElement dayView = this.radScheduler.SchedulerElement.ViewElement as SchedulerDayViewElement;
                List<SchedulerCellElement> cells = SchedulerUIHelper.GetCells(dayView.DataAreaElement.Table.Children);
                List<SchedulerCellElement> selectedCells = new List<SchedulerCellElement>();

                DateTime startSelectedDate = DateTime.MaxValue;
                DateTime endSelectedDate = DateTime.MinValue;

                foreach (SchedulerCellElement cell in cells)
                {
                    if (cell.Selected)
                    {
                        startSelectedDate = startSelectedDate > cell.Date ? cell.Date : startSelectedDate;
                        endSelectedDate = endSelectedDate < cell.Date ? cell.Date : endSelectedDate;
                        selectedCells.Add(cell);
                    }
                }
            }

    Please let me know if you need more assistance.
    I hope this helps.

    All the best,
    Boyko Markov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

    Reply

  • JJ avatar

    Posted on Apr 1, 2010 (permalink)

    Public Sub New()  
            'InitializeComponent()  
     
            Me.cmbShowTimeAs = TryCast(Me.Controls("cmbShowTimeAs"), RadComboBox)  
        End Sub  
     In the above code I am getting the following error message on the InitializeComponent()
    Error 1 'Telerik.WinControls.UI.Scheduler.Dialogs.EditAppointmentDialog.Private Sub InitializeComponent()' is not accessible in this context because it is 'Private'. C:\Documents and Settings\Masood\My Documents\Projects\RadControlsWinFormsApp1\RadControlsWinFormsApp1\Form1.vb 14 9 RadControlsWinFormsApp1

        Private Sub chkConfirmed_ToggleStateChanged(ByVal sender As Object, ByVal args As StateChangedEventArgs)  
            Me.cmbShowTimeAs.SelectedValue = If((args.ToggleState = ToggleState.[On]), DirectCast(AppointmentStatus.Busy, Integer), DirectCast(AppointmentStatus.Tentative, Integer))  
        End Sub 
    and in the IF statement above I am getting expression expected error.

    I copied the C# code and used the converter to change to VB, Trying to customize the Edit Appointment Dialoge using VS2005
    Thanks
    JJ

    Reply

  • Dobry Zranchev Dobry Zranchev admin's avatar

    Posted on Apr 2, 2010 (permalink)

    Hi JJ,

    Thank you for writing.

    Please, review the example, which is installed with the controls, namely Scheduler >> Binding. It comes with VB code as well. You can take a closer look at the how to inherit EditAppointmentDialog.


    Greetings,
    Dobry Zranchev
    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.

    Reply

  • Rakesh avatar

    Posted on Jun 22, 2010 (permalink)

    Hi,

    Instead of opening telerik new appointment window, I want to open some other custom window. how would I be able to override the edit appointment dialogbox?

    Thanks,
    Rakesh

    Reply

  • Dobry Zranchev Dobry Zranchev admin's avatar

    Posted on Jun 28, 2010 (permalink)

    Hi Rakesh,

    Thank you for writing. Please, take a look in this help article for the custom EditAppointmentDialog.

    If you have other questions feel free to contact us.

    Sincerely yours,
    Dobry Zranchev
    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

    Reply

  • cooper avatar

    Posted on Aug 4, 2010 (permalink)

    hi .. is it possible to edit all the labels in the edit appointment dialog using LocalizationProvider  or we can just edit a single label text??

    Reply

  • Dobry Zranchev Dobry Zranchev admin's avatar

    Posted on Aug 4, 2010 (permalink)

    Hi cooper,

    Thank you for writing. You could localize all of the label string in the dialog. See the documentation for more information.

    Regards,
    Dobry Zranchev
    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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Scheduler and Reminder > Edit Appointment Dialogue
Related resources for "Edit Appointment Dialogue"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]