You are currently viewing the BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
Can anyone help, I have completed Chapter 7 so that i can add, update & delete projects and Groups.
That works fine, however the list views (lvwProjects & lvwGroups) do not re-load the data after an update or delete. When i click on the updated record it displays the updated version in the text boxes but the list view continues to show the pre-updated version.
The methods that update and delete call the LoadGroups/LoadProjects procedure on completion, and that contains a lvwGroups.items.clear, so I cannot understand why it does not show the updated version.
Is the last line of code in the Add, Update, and Delete procedures for each of these a call to the LoadProjects or LoadGroups procedures? If so, then set a breakpoint on those lines and ensure that you are indeed getting to those procedures and see what is happening in those load procedures.
I have stepped through the code from the point it calls the loadProjects/Loadgroups procedure and it calls the 'lvwGroups.items.clear' without error, but still does not reload the data in the list view, but retains the pre-modified data.
Could this be a bug in the listview control? (I have installed Sp1 for VS2005)
Can you give me another way to clear the data and reload into the list view?
This is not a big problem and is not stopping me from progressing through your book, but it is somewhat puzzling
The ListView control should clear without any problems. May I suggest that you download the code from the Wrox website for this book and compare those load procedures with your own. That may help point out any potential discrepancies in your code.