Hi,
In my application i am using shape files to load in WPFControl. When i try to delete a feature from the editable layer, i am getting "Index was outside the bounds of the array." error. This error occurs at mapControl.Refresh.
Code:
ShapeFileFeatureLayer DeletionLayer = (ShapeFileFeatureLayer)mapControl.FindFeatureLayer(EditableLayerName);
DeletionLayer.Open();
if (!DeletionLayer.EditTools.IsInTransaction)
DeletionLayer.EditTools.BeginTransaction();
DeletionLayer.EditTools.Delete(selectedFeatures[0].Id);
mapControl.EditOverlay.EditShapesLayer.EditTools.BeginTransaction();
mapControl.EditOverlay.EditShapesLayer.InternalFeatures.Remove(selectedFeatures[0].Id);
mapControl.EditOverlay.EditShapesLayer.EditTools.Delete(selectedFeatures[0].Id);
mapControl.EditOverlay.EditShapesLayer.EditTools.CommitTransaction();
DeletionLayer.EditTools.CommitTransaction();
DeletionLayer.Close();
mapControl.Refresh();