I have a Devexpress Gridview that is linked to a delete, fetch and update stored procedure. The problem I am having is that when I run my program, select a row in the grid and press delete it fires the event multiple times. Specifically it deletes the selected row and then I re-fetch the data so the focus returns to the first row. Which is what I want. Unfortunately it starts at the beginning of my list and goes down it row by row deleting each row it comes to. It then continues several more times after the rows are deleted. I know this because for each deleted row it asks me if I want to delete it. If I say no then the rows appear to disappear until I manually refresh it after the deleting is done. To make this even more random the second row always reappears after I manually refresh the grid.
I saw that most people who had this problem on the internet had the event matched to several objects yet I don't create the actionlistener myself the designer code did this once and I have set it up the same way I always do. In addition I tried to debug this (Visual Studio 2008) and it doesn't stop at the breakpoints even though it prints out the line directly below the line.
EDIT:
I have narrowed down the problem. I didn't mention before but I have a treelist that displays the names of departments and their employees. When a department is clicked it shows the grid mentioned above in the right pane of the window. When the program is first started the delete actionlistener is just fired once. When I select a second department a choose a row in the grid it is fired twice. Basically every time I select a different department there is another delete fired. So if I have selected another department 5 times then when I try to delete a row the delete is fired 5 times.