G
Guest
Hi,
My problem is the next one (in a windows application):
- I have a class derived from collectionbase to fill with persons object
(id, name) from database.
- I have a ListBox wich datasource its the collectionbase above.
I want to do:
- I would like that when i click in a item of the listbox, deletes from
database the values of this item, and from collection too. Then refresh the
listbox with the collection modified.
My situation:
- I select a item from ListBox, then delete from database
the ID of the Item in database, then i delete the selectedindex from
collection of objects, and then i clear the items from the listbox and i
assign again the datasource to the collection (with the object
removed)...
My problem:
- The program works, except if select the last item to remove. In this case
the item is well removed, but when i will selected another item of the
listbox, i get an IndexOutOfRange exception...
My problem is the next one (in a windows application):
- I have a class derived from collectionbase to fill with persons object
(id, name) from database.
- I have a ListBox wich datasource its the collectionbase above.
I want to do:
- I would like that when i click in a item of the listbox, deletes from
database the values of this item, and from collection too. Then refresh the
listbox with the collection modified.
My situation:
- I select a item from ListBox, then delete from database
the ID of the Item in database, then i delete the selectedindex from
collection of objects, and then i clear the items from the listbox and i
assign again the datasource to the collection (with the object
removed)...
My problem:
- The program works, except if select the last item to remove. In this case
the item is well removed, but when i will selected another item of the
listbox, i get an IndexOutOfRange exception...