I am trying to validate an email address before proceeding with edits on a SDE feature layer. The edits are taking place via a FeatureDataForm. I have the following code. private void FeatureLayer_BeginSaveEdits(object sender, ESRI.ArcGIS.Client.Tasks.BeginEditEventArgs e)
{
Graphic SelectedGraphic = MyFeatureDataForm.GraphicSource;
IDictionary<string, object> attributes = SelectedGraphic.Attributes;
var msgToAM = attributes["AMEmail"] as string;
var msgToPM = attributes["PMEmail"] as string;
var msgToSat = attributes["WkEndEmail"] as string;
var msgLocation = attributes["Location"] as string;
if (SelectedFeatureLayer.ID == "AllAvailableFeatureLayer" )
{
if ((msgToAM.Length == 0 || msgToAM == "Type email here") & (msgToPM.Length == 0 || msgToPM == "Type email here"))
{
MessageBox.Show("Please provide a valid email address.");
return ;
}
}
}
This works but the save continues. How can I stop the save after the messagebox is displayed?Thanks.