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

How to stay on CustomAppointmentEditDialog form when check out some data is wrong?

3 Answers 15 Views
This is a migrated thread and some comments may be shown as answers.
Cooper
Top achievements
Rank 1
Cooper asked on 14 Jul 2014, 02:57 AM
Hi telerik Member:

We need check some data before leave CustomAppointmentEditDialog form. 
How can i stay on CustomAppointmentEditDialog form after check out some data is wrong?
And same question in delete button.



CustomerID: QD1612651

3 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 15 Jul 2014, 07:29 AM
Hi Cooper,

Thank you for writing.

You can override the ValidateInput method of the EditAppointmentDialog an validate your data in there. This method is called once the OK button is clicked and if it returns false, the dialog will not be closed. Here is a small sample:
protected override bool ValidateInput()
{
    bool result = base.ValidateInput();
 
    if (txtEmail.Text == string.Empty)
    {
        this.errorProvider.SetError(this.txtEmail, "Emails field cannot be empty");
        return false;
    }
    return result;
}

I hope that you find this information useful.

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.
 
0
Cooper
Top achievements
Rank 1
answered on 17 Jul 2014, 02:17 AM
Thanks, it solved my problem.  

I have the same question with the delete button.

How do i stay on CustomAppointmentEditDialog Form after canceled the delete confirm dialog?
0
Stefan
Telerik team
answered on 18 Jul 2014, 09:21 AM
Hi Cooper,

There is a method for the DeleteButton as well. It is called OnDeleteButtonClicked. Here is what is does:
protected virtual void OnDeleteButtonClicked()
{
    this.DeleteEvent();
    this.DialogResult = DialogResult.Abort;
    this.Close();
}

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.
 
Asked by
Cooper
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Cooper
Top achievements
Rank 1
Share this question
or