Can I create to EditAppointmentDialog for me ?

9 posts, 0 answers
  1. peeth
    peeth avatar
    2 posts
    Member since:
    Aug 2008

    Posted 19 Apr 2009 Link to this post

    Can I create to EditAppointmentDialog for me ?


  2. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 20 Apr 2009 Link to this post

    Hi peeth,

    Yes you can. You have to subscribe to the AppointmentEditDialogShowing event using the following code:

         this.radScheduler1.AppointmentEditDialogShowing += new EventHandler<AppointmentEditDialogShowingEventArgs>(radScheduler1_AppointmentEditDialogShowing);
       
    Then in the event handler where you can change the dialog. Here is the sample code demonstrating this:

    void radScheduler1_AppointmentEditDialogShowing(object sender, Telerik.WinControls.UI.AppointmentEditDialogShowingEventArgs e)
            {
                if (this.appointmentEditDialog == null)
                {
                    this.appointmentEditDialog = new CustomAppointmentEditDialog();
                }
                e.AppointmentEditDialog = this.appointmentEditDialog;
            }

    CustomAppointmentEditDialog is the dialog you need to prepare. In the sample code we use a dialog which inherits the EditAppointmentDialog. I suggest you do the same and modify the dialog as you wish.

    I hope this helps.

    Greetings,
    Boyko Markov
    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. peeth
    peeth avatar
    2 posts
    Member since:
    Aug 2008

    Posted 20 Apr 2009 Link to this post

     

    Thank you for your kind reponse.
    But. I found two error messages like "
    Error 1 The type or namespace name 'EditAppointmentDialog' could not be found (are you missing a using directive or an assembly reference?) 

    Error 2 The type or namespace name 'AppointmentEditDialogShowingEventArgs' could not be found (are you missing a using directive or an assembly reference?) "

    CustomAppointmentDialog
    appointmentDialog = null;

     

     

    void radScheduler1_AppointmentEditDialogShowing(object sender, AppointmentEditDialogShowingEventArgs e)

     

    {

     

    if (this.appointmentDialog == null)

     

    {

     

    this.appointmentDialog = new CustomAppointmentDialog();

     

    }

    e.AppointmentEditDialog =

    this.appointmentDialog;

     

    }

     

     

    public class CustomAppointmentDialog : EditAppointmentDialog

     

    {

     

    public CustomAppointmentDialog()

     

    :

    base()

     

    {

     

     

     

    }

    }

  5. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 22 Apr 2009 Link to this post

    Hello peeth,

    EditAppointmentDialog class is in the Telerik.WinControls.UI.Scheduler.Dialogs namespace.
    AppointmentEditDialogShowingEventArgs class is in the Telerik.WinControls.UI namespace.
    Please make sure that you have added the using statements in the beginning of your .cs file i.e
    using Telerik.WinControls.UI.Scheduler.Dialogs;
    using Telerik.WinControls.UI;

    I hope this helps.

    Best wishes,
    Boyko Markov
    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.
  6. Tiago
    Tiago avatar
    25 posts
    Member since:
    Aug 2009

    Posted 06 Aug 2009 Link to this post

    Hi,

    The following event is running ...

    void radScheduler1_AppointmentEditDialogShowing(object sender, Telerik.WinControls.UI.AppointmentEditDialogShowingEventArgs e)  
            {  
                if (this.appointmentEditDialog == null)  
                {  
                    this.appointmentEditDialog = new CustomAppointmentEditDialog();  
                }  
                e.AppointmentEditDialog = this.appointmentEditDialog;  
            } 

    ... the problem is that the AppointmentEditDialogShowing that is showd is the older one ... i mean, the original from Telerik.

    I got this code in my Form1 where is the radSchedular:

    private void Form1_Load(object sender, EventArgs e)  
            {  
                //RadSchedulerLocalizationProvider.CurrentProvider = new CustomLocalizationProvider();  
                //this.radScheduler1.AppointmentEditDialogShowing += new EventHandler<AppointmentEditDialogShowingEventArgs>(radScheduler1_AppointmentEditDialogShowing);  
     
                radScheduler1.GetDayView().DayCount = 5;  
                radScheduler1.HeaderFormat = "dd MMMMMMMM, yyy";  
            } 

    the

    this.radScheduler1.AppointmentEditDialogShowing += new EventHandler<AppointmentEditDialogShowingEventArgs>(radScheduler1_AppointmentEditDialogShowing); 

    is on the Form1.Designer.cs side.

    In the radSchedular Properties » Events i have AppointmentEditDialogShowing  =  radScheduler1_AppointmentEditDialogShowing !!!

    Finally, this is the CustumAppointmentEdirDialog.cs

    public class CustomAppointmentEditDialog:EditAppointmentDialog  
        {  
            private Telerik.WinControls.UI.RadCalendar radCalendar1;  
     
            private void InitializeComponent()  
            {  
                System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CustomAppointmentEditDialog));  
                this.radCalendar1 = new Telerik.WinControls.UI.RadCalendar();  
                ((System.ComponentModel.ISupportInitialize)(this.txtSubject)).BeginInit();  
                ((System.ComponentModel.ISupportInitialize)(this.txtLocation)).BeginInit();  
                ((System.ComponentModel.ISupportInitialize)(this.cmbBackground)).BeginInit();  
                ((System.ComponentModel.ISupportInitialize)(this.dateStart)).BeginInit();  
                ((System.ComponentModel.ISupportInitialize)(this.timeStart)).BeginInit();  
                ((System.ComponentModel.ISupportInitialize)(this.dateEnd)).BeginInit();  
                ((System.ComponentModel.ISupportInitialize)(this.timeEnd)).BeginInit();  
                ((System.ComponentModel.ISupportInitialize)(this.chkAllDay)).BeginInit();  
                ((System.ComponentModel.ISupportInitialize)(this.cmbResource)).BeginInit();  
                ((System.ComponentModel.ISupportInitialize)(this.cmbShowTimeAs)).BeginInit();  
                ((System.ComponentModel.ISupportInitialize)(this.txtDescription)).BeginInit();  
                ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();  
                ((System.ComponentModel.ISupportInitialize)(this.radCalendar1)).BeginInit();  
                ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();  
                this.SuspendLayout();  
                //   
                // dateStart  
                //   
                this.dateStart.Value = new System.DateTime(2009, 8, 6, 10, 28, 34, 340);  
                //   
                // timeStart  
                //   
                this.timeStart.Value = new System.DateTime(2009, 8, 6, 10, 28, 34, 340);  
                //   
                // dateEnd  
                //   
                this.dateEnd.Value = new System.DateTime(2009, 8, 6, 10, 28, 34, 340);  
                //   
                // timeEnd  
                //   
                this.timeEnd.Value = new System.DateTime(2009, 8, 6, 10, 28, 34, 340);  
                //   
                // txtDescription  
                //   
                //   
                //   
                //   
                this.txtDescription.RootElement.StretchVertically = true;  
                //   
                // radCalendar1  
                //   
                this.radCalendar1.CellAlign = System.Drawing.ContentAlignment.MiddleCenter;  
                this.radCalendar1.Culture = new System.Globalization.CultureInfo("pt-PT");  
                this.radCalendar1.HeaderHeight = 17;  
                this.radCalendar1.HeaderWidth = 17;  
                this.radCalendar1.Location = new System.Drawing.Point(270, 59);  
                this.radCalendar1.Name = "radCalendar1";  
                this.radCalendar1.RangeMaxDate = new System.DateTime(2099, 12, 30, 0, 0, 0, 0);  
                this.radCalendar1.Size = new System.Drawing.Size(257, 227);  
                this.radCalendar1.TabIndex = 22;  
                this.radCalendar1.Text = "radCalendar1";  
                this.radCalendar1.TitleAlign = System.Windows.Forms.VisualStyles.ContentAlignment.Center;  
                this.radCalendar1.ZoomFactor = 1.2F;  
                //   
                // CustomAppointmentEditDialog  
                //   
                this.ClientSize = new System.Drawing.Size(539, 365);  
                this.Controls.Add(this.radCalendar1);  
                this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));  
                this.Name = "CustomAppointmentEditDialog";  
                //   
                //   
                //   
                this.RootElement.ApplyShapeToControl = true;  
                this.RootElement.MinSize = new System.Drawing.Size(539, 365);  
                this.Text = "Edit Appointment";  
                this.Load += new System.EventHandler(this.CustomAppointmentEditDialog_Load);  
                this.Controls.SetChildIndex(this.txtSubject, 0);  
                this.Controls.SetChildIndex(this.txtLocation, 0);  
                this.Controls.SetChildIndex(this.cmbBackground, 0);  
                this.Controls.SetChildIndex(this.dateStart, 0);  
                this.Controls.SetChildIndex(this.timeStart, 0);  
                this.Controls.SetChildIndex(this.dateEnd, 0);  
                this.Controls.SetChildIndex(this.timeEnd, 0);  
                this.Controls.SetChildIndex(this.chkAllDay, 0);  
                this.Controls.SetChildIndex(this.cmbResource, 0);  
                this.Controls.SetChildIndex(this.cmbShowTimeAs, 0);  
                this.Controls.SetChildIndex(this.txtDescription, 0);  
                this.Controls.SetChildIndex(this.radCalendar1, 0);  
                ((System.ComponentModel.ISupportInitialize)(this.txtSubject)).EndInit();  
                ((System.ComponentModel.ISupportInitialize)(this.txtLocation)).EndInit();  
                ((System.ComponentModel.ISupportInitialize)(this.cmbBackground)).EndInit();  
                ((System.ComponentModel.ISupportInitialize)(this.dateStart)).EndInit();  
                ((System.ComponentModel.ISupportInitialize)(this.timeStart)).EndInit();  
                ((System.ComponentModel.ISupportInitialize)(this.dateEnd)).EndInit();  
                ((System.ComponentModel.ISupportInitialize)(this.timeEnd)).EndInit();  
                ((System.ComponentModel.ISupportInitialize)(this.chkAllDay)).EndInit();  
                ((System.ComponentModel.ISupportInitialize)(this.cmbResource)).EndInit();  
                ((System.ComponentModel.ISupportInitialize)(this.cmbShowTimeAs)).EndInit();  
                ((System.ComponentModel.ISupportInitialize)(this.txtDescription)).EndInit();  
                ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();  
                ((System.ComponentModel.ISupportInitialize)(this.radCalendar1)).EndInit();  
                ((System.ComponentModel.ISupportInitialize)(this)).EndInit();  
                this.ResumeLayout(false);  
                this.PerformLayout();  
     
            }  
     
            private void CustomAppointmentEditDialog_Load(object sender, EventArgs e)  
            {  
     
            }    
       
     
        } 


    What am i doing wrong??

    Thanks in advance.
  7. Tiago
    Tiago avatar
    25 posts
    Member since:
    Aug 2009

    Posted 06 Aug 2009 Link to this post

    Dear friends,

    Solved the problem ... I think i was doing something wrong in the CustomAppointmentEditDialog. And this is because i created a new Inherited Class by using in the Solution Browser Add»New Item»InheritedForm and them just navigate to the Telerik bin folder in Programs folder and there we go!!! :)

    It was more simple that adding the code to a new class.

    Once again, thanks for letting me use your space.
  8. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 07 Aug 2009 Link to this post

    Hi Tiago Pinho,

    We are happy that everything is working well with RadScheduler. I can suggest you also to take a look at the implementation of our Binding example with RadScheduler in the Demo Application provided with the installation. The example actually uses a custom created dialog instead of the default one. We have added in the custom dialog one more edit field - "e-mail".

    Please write us back if you have other questions.

    Best wishes,
    Boyko Markov
    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.
  9. alexander arias
    alexander arias avatar
    2 posts
    Member since:
    Mar 2004

    Posted 12 Jul 2010 Link to this post

    In vb I have the same message: El tipo AppointmentEditDialogShowingEventArgs  no esta definido. I have this:

    Imports Telerik.WinControls.UI
    Imports Telerik.WinControls
    Imports Telerik.WinControls.UI.Scheduler.Dialogs


    Thanks a lot!!!


  10. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 13 Jul 2010 Link to this post

    Hi alexander arias,

    Thank you for writing.

    We were not able to reproduce your problem, however it seems that you should import only Telerik.WinControls.UI namespace. If you still have a problem please provide a sample example and more information on when this error started to appear, and I will try to solve it.

    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
Back to Top
UI for WinForms is Visual Studio 2017 Ready