Hi All,
I need to avoid the data saving once validation fails. I wrote a method in RowPersisting event. Validation message comes but data is going to save .So I need to return from the saving until validation sucess.
Here is my code.
protected void _(Events.RowPersisting<HMRCAPIConfigDetail> e)
{
HMRCAPIConfigDetail row = e.Row;
if(row != null)
{
if(String.IsNullOrEmpty(row.Description))
{
string msg = "Description Cannot be Empty";
WebDialogResult result = HMRCAPIConfigDetails.Ask(ActionsMessages.Warning, msg, MessageButtons.OK, MessageIcon.Warning, true);
return;
}
}
}
Thanks