How to tell if user is saving a new record or updating existing one

4 posts, 0 answers
  1. DMC Helpdesk
    DMC Helpdesk avatar
    52 posts
    Member since:
    Nov 2007

    Posted 17 Jan 2012 Link to this post

    private void MyForm_EditEnded(object sender, Telerik.Windows.Controls.Data.DataForm.EditEndedEventArgs e)
            {
                if (e.EditAction == Telerik.Windows.Controls.Data.DataForm.EditAction.Commit)
                {
                   //if saving new record
     
                 //else if updating existing record
                     
                }
            }

    Thanks

    Madani

  2. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 17 Jan 2012 Link to this post

    Hello Madani,

    Try subscribing to RadDataForm's AddedNewItem event, in order to get reference to the last added item. Then you can compare it with the current edited item. EditEnded's arguments are intended only to describe the result of the editing process.

    Kind regards,
    Ivan Ivanov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. DMC Helpdesk
    DMC Helpdesk avatar
    52 posts
    Member since:
    Nov 2007

    Posted 18 Jan 2012 Link to this post

    Thanks Ivan.But there is no such event with the name "AddedNewItem".I can olny see the event "AddingNewItem ".

    Thanks

    Madani
     
     
  5. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 18 Jan 2012 Link to this post

    Hello Madani,

    Would you please share with us which version of RadControls you are currently using?

    All the best,
    Ivan Ivanov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top