Hi,
I have tried to arrange so that when I delete a name in the listview it should also delete the name in the textfile that the listview is reading from. When I delete in the listview the name that was below the deleted name now moves up a place in the listview and unfortunately gets the deleted names resources.
Here is the code for deleting from the listview:
void Delete()
{
try
{
if (listViewKunder.SelectedItems.Count > 0)
{
listViewKunder.Items.Remove(listViewKunder.SelectedItems[0]);
lkunder.RemoveAt(listViewKunder.SelectedItems[0].Index);
}
}
catch { }
}
So what should is do when I want the textfile to also delete the same things that gets deleted when I delete something in the listview? and why is the information from the deleted name passing on to the next name in the list, what can be done so that that information really gets deleted and the names in the list keeps their own information?
I have added 3 pics of the form so you guys get an idea of how it looks. in the third picture i have selected the name Hugo but in the info boxes it still say "Bettan" as Bettan used to be in that place in the list.