problems with editdeleteshape() in 4.7 version

Apr 29, 2011 at 9:29 AM


in my application, i clear the shapefile using the editdeleteshape(), passing as parameter the index of the shape i want to delete.

I have problem with a shapefile: i have the error "index out of bounds"when i perform a shape delete, but in shape creation i pass the shape index and i store it in an array to reuse it in delete action...

any suggestion?


Apr 29, 2011 at 3:57 PM

Try this.

  myshafile.StartEditingShapes(true, null);
  myshafile.StopEditingShapes(true, true, null);
  myshafile.CursorMode = MapWinGIS.tkCursorMode.cmNone;

May 4, 2011 at 11:54 AM


i've resolved the problem deleting the shapefile starting from last shape to first...i don't know why, but it works!

May 31, 2011 at 9:02 PM

Just like when using an iterator, removing items from the collection can alter an items position.  When a shape is deleted, the index of the rest of the shapes located after the deleted shape change.  If you have a list of shape indices that need deleted, the indexes need to be deleted from largest to smallest.