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 ;
}
}
}Don,
You should set the AutoSave to False and listen to EditEnded instead of BeginSaveEdits. Check out this forum discussion as well.
<esri:FeatureLayer ID="AllAvailableFeatureLayer"
Url="http://gismaps.pagnet.org/ArcGIS/rest/services/BikeCountLocations/FeatureServer/0"
Renderer="{StaticResource AllRenderer}"
MouseLeftButtonUp="FeatureLayer_MouseLeftButtonUp"
SelectionColor="Yellow"
OutFields="Location,AMVolunteer,AMPhone,AMEmail,PMVolunteer,PMPhone,PMEmail"
DisableClientCaching="True"
Where="AMVolunteer = 'Available' and PMVolunteer = 'Available'"
AutoSave="False"
BeginSaveEdits="FeatureLayer_BeginSaveEdits"
EndSaveEdits="FeatureLayer_EndSaveEdits"
EditEnded="featureLayer_EditEnded" >
Don,
You should set the AutoSave to False and listen to EditEnded instead of BeginSaveEdits. Check out this forum discussion as well.