show AppointmentEditDialog by custome menu click event

9 posts, 0 answers
  1. Sanjaya Kodagoda
    Sanjaya Kodagoda avatar
    10 posts
    Member since:
    Mar 2006

    Posted 01 Dec 2010 Link to this post

    Hi
    I want to load RadScheduler AppointmentEditDialog from custom menu click event.
    I try to raise the RadScheduler1_AppointmentEditDialogShowing event in custom menu click event by the following code;
        Private Sub menuItem1_Click(ByVal sender As System.Object, ByVal e As EventArgs)
            Dim ep As New Telerik.WinControls.UI.Scheduler.Dialogs.EditAppointmentDialog
            Dim ev As Telerik.WinControls.UI.IEvent
            Dim evt As New Telerik.WinControls.UI.AppointmentEditDialogShowingEventArgs(ev, ep)
            RadScheduler1_AppointmentEditDialogShowing(Nothing, evt)
        End Sub


    But the EditAppointmentDialog not loading. Please help me to do this

  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 02 Dec 2010 Link to this post

    Hello,

    this forum thread should have yuor answer.
    I hope that helps, but let me know if you need more assistance
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Sanjaya Kodagoda
    Sanjaya Kodagoda avatar
    10 posts
    Member since:
    Mar 2006

    Posted 02 Dec 2010 Link to this post

    Hi Richard
    No that is not use full for me , My problem is different than that.  I customize the RadScheduler1_ContextMenuShowing event and add new menu item. So I want to load the AppointmentEditDialog from the new menu. Same like the existing “New Appointment” menu
  5. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 03 Dec 2010 Link to this post

    Hello Sanjaya Kodagoda,

    Thank you for writing back.

    RadScheduler contains a method that shows the EditAppointmentDialog, but it is not public. If you want to access it, you have to create a class that inherits RadScheduler and expose the new method that calls the existing one.
    public class TestScheduler : RadScheduler
    {
        public void ShowEditAppointmentDialog(IEvent appointment, bool recurringAppointment)
        {
            this.ShowAppointmentEditDialog(appointment, recurringAppointment);
        }
    }

    After the extended RadScheduler class is created, you should use instances of this custom class.

    Feel free to write back if you have further questions.

    Kind regards,
    Dobry Zranchev
    the Telerik team
    Get started with RadControls for WinForms with numerous videos and detailed documentation.
  6. Shruti
    Shruti avatar
    11 posts
    Member since:
    Nov 2010

    Posted 05 Dec 2010 Link to this post

    hi!!
       I want to display the EditAppointmentDialog after clicking a button in other form(this form is different than the form where i have my radschedular)

    I used the following code which was given by telerik team.

    public class TestScheduler : RadScheduler
    {
        public void ShowEditAppointmentDialog(IEvent appointment, bool recurringAppointment)
        {
            this.ShowAppointmentEditDialog(appointment, recurringAppointment);
        }
    }

    I am creating an instance of this class in the click event of a button as TestScheduler test = new TestScheduler();

    for test.ShowEditAppointmentDialog(IEvent appointment, bool recurringAppointment)

    what parameters i should give? as no appointment is created yet and my EditAppoinmentDialog don't have recurrence control

    Can you please tell me how i can display the EditAppointmentDialog when a button on other form is clicked?


  7. Shruti
    Shruti avatar
    11 posts
    Member since:
    Nov 2010

    Posted 05 Dec 2010 Link to this post

    Can anyone please help me with the above question?
  8. Sanjaya Kodagoda
    Sanjaya Kodagoda avatar
    10 posts
    Member since:
    Mar 2006

    Posted 08 Dec 2010 Link to this post

    HI,
    thanks for the reply. this work fine but please let me know how to load the custom AppointmentEditDialog from custom menu click event.   
  9. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 08 Dec 2010 Link to this post

    Hello,

    In order to launch a new appointment edit dialog from a menu or button perform the following:

    Add a new class that inherits from RadScheduler
    Imports Telerik.WinControls.UI
      
    Public Class MyScheduler
        Inherits Telerik.WinControls.UI.RadScheduler
      
        Public Sub New()
            Me.ThemeClassName = "Telerik.WinControls.UI.RadScheduler"
        End Sub
      
        Public Sub ShowEditAppointmentDialog(ByVal appointment As IEvent, ByVal recurringAppointment As Boolean)
            MyBase.ShowAppointmentEditDialog(appointment, recurringAppointment)
        End Sub
      
    End Class

    In your menu click
    Me.MyScheduler1.ShowEditAppointmentDialog(New Appointment(New Date(2010, 12, 10), New Date(2010, 12, 11), "Summary", "Description"), False)

    Hope that helps, but let me know if you need more information
    Richard
  10. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 08 Dec 2010 Link to this post

    Hi guys,

    Thank you for writing.

    @Shruti, you can use the solution provided by Richard.

    @Richard, thank you for your assistance. Your Telerik points have been updated for the cooperation.

    @Sanjaya, you can replace the built-in EditAppointmentDialog with a custom one by handling the AppointmentEditDialogShowing event. For additional information, please refer to this article.

    If you have additional questions, feel free to write us.

    Best wishes,
    Dobry Zranchev
    the Telerik team
    Get started with RadControls for WinForms with numerous videos and detailed documentation.
Back to Top
UI for WinForms is Visual Studio 2017 Ready