Click to See Complete Forum and Search --> : Error removing the last item from a listview through a ContextMenu


Declan
December 13th, 2002, 03:35 AM
I get an unhadles error when I try to remove the last item from a listview.

I've added a context menu on the onclick event of the listview, which contains a 'Remove Item' menu item, but if I try to remove the LAST item in the listview, I get a system.windows.forms "A required parameter was not found" error.

The code to remove the item is in the click event of the "Remove Item" menu item.

I'v tried setting focus to everything on the form, refreshing the listview and the form, but nothing works.

Does anyone know what is causing this, and how I can fix it???