This is a migrated thread and some comments may be shown as answers.

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

3 Answers 50 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
DMC Helpdesk
Top achievements
Rank 1
DMC Helpdesk asked on 17 Jan 2012, 01:54 PM
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

3 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 17 Jan 2012, 02:36 PM
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 >>
0
DMC Helpdesk
Top achievements
Rank 1
answered on 18 Jan 2012, 08:13 AM
Thanks Ivan.But there is no such event with the name "AddedNewItem".I can olny see the event "AddingNewItem ".

Thanks

Madani
 
 
0
Ivan Ivanov
Telerik team
answered on 18 Jan 2012, 10:05 AM
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 >>
Tags
DataForm
Asked by
DMC Helpdesk
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
DMC Helpdesk
Top achievements
Rank 1
Share this question
or