I use ArcGIS online and the ArcGIS Runtime for WPF products. I am able to add and edit features perfectly fine from code, however I can not delete them from code. I also can remove them from the Datagrid and manually through ArcGIS online.
The code I am currently is below:
private void RemoveQueryTask_ExecuteCompleted(object sender, ESRI.ArcGIS.Client.Tasks.QueryEventArgs args)
{
FeatureLayer featurelayerSO = MyMap.Layers["ServiceOrders"] as FeatureLayer;
FeatureSet featureSet = args.FeatureSet;
try
{
if (featureSet.Features.Count > 0)
{
featurelayerSO.Graphics.Remove(featureSet.Features[0]);
featurelayerSO.SaveEdits();
featurelayerSO.Update();
}
else
{
MessageBox.Show("No features found");
}
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
When I step through this code, all of the values are showing as they should. The featureSet.Features[0] is exactly what I want it to be.. Any help would be appreciated. I am sure there is something simple I am missing.
Attached is a photo of the supported operations.