How to get the save/close event on edit dialog?

6 posts, 1 answers
  1. Volkan
    Volkan avatar
    2 posts
    Member since:
    Sep 2012

    Posted 12 May 2014 Link to this post

    Hi, im searching the Close/save event on closing the edit dialog from a appointment.

    Anyone a idea how to get this?

    I have there a lot of events like this:

    adScheduler1_AppointmentDeleted/Adding/Added/Moving/Deleted, but not changed :(

    Thank you in advance for any help.
    Volkan
  2. Answer
    Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 14 May 2014 Link to this post

    Hi Volkan,

    Thank you for writing.

    If I understand correctly, you want to capture the closure of the AppointmentEditDialog. If so, you can use the AppointmentEditDialogShowing event, which is triggered when the dialog is being opened. In it, you can access the dialog itself and subscribe to its events:
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
     
        AddScheduler();
        radScheduler1.AppointmentEditDialogShowing += radScheduler1_AppointmentEditDialogShowing;
    }
     
    void radScheduler1_AppointmentEditDialogShowing(object sender, AppointmentEditDialogShowingEventArgs e)
    {
        ((Form)e.AppointmentEditDialog).FormClosed += Form1_FormClosed;
        ((Form)e.AppointmentEditDialog).FormClosed += Form1_FormClosed;
    }
     
    void Form1_FormClosed(object sender, FormClosedEventArgs e)
    {
        //do something
    }

    I hope this helps.

    Regards,
    Stefan
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Volkan
    Volkan avatar
    2 posts
    Member since:
    Sep 2012

    Posted 27 May 2014 in reply to Stefan Link to this post

    Thank you Stefan, that worked ;)
  5. JAVI AYESA
    JAVI AYESA avatar
    4 posts
    Member since:
    Dec 2013

    Posted 16 Jan 2015 Link to this post

    do you can post code in vb.net?

    Thanks
  6. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 16 Jan 2015 Link to this post

    Here you are:
    Protected Overrides Sub OnLoad(e As EventArgs)
        MyBase.OnLoad(e)
     
        AddScheduler()
        AddHandler radScheduler1.AppointmentEditDialogShowing, AddressOf radScheduler1_AppointmentEditDialogShowing
    End Sub
     
    Private Sub radScheduler1_AppointmentEditDialogShowing(sender As Object, e As AppointmentEditDialogShowingEventArgs)
        AddHandler DirectCast(e.AppointmentEditDialog, Form).FormClosed, AddressOf Form1_FormClosed
        AddHandler DirectCast(e.AppointmentEditDialog, Form).FormClosed, AddressOf Form1_FormClosed
    End Sub
     
    Private Sub Form1_FormClosed(sender As Object, e As FormClosedEventArgs)
        'do something
    End Sub

    When you need conversion between C# and VB, you can use our free online converter at: http://converter.telerik.com/.

    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  7. JAVI AYESA
    JAVI AYESA avatar
    4 posts
    Member since:
    Dec 2013

    Posted 16 Jan 2015 in reply to Stefan Link to this post

    Perfect!!
Back to Top
UI for WinForms is Visual Studio 2017 Ready