[Help] Listview won't refresh
Hey, I could use some help.
I have two windows forms. On the second form I select an item that is added to a list of items in a database, this works perfectly. After it has been added I close the second form and I want the listview on the first form to be refreshed. But the listview turns up completly blank, not even the columnheaders appear. I know the function fillListView() works as well because I've used it elsewhere.
This is my code, I think there is something I'm missing here:
Try
Dim oForm As New AddToList(moList)
oForm.ShowDialog()
lvwDetailsList.Clear()
fillListView()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
'End code
Some help would be great.
Re: [Help] Listview won't refresh
Your code looks suspiciously like VB .NET to me, so you'd probably have a better chance to get answers in the appropriate forum. The one here is for VB6.
Please use code tags when posting code.
Ah, and... Welcome to CodeGuru, anyway! :)
Re: [Help] Listview won't refresh
Quote:
lvwDetailsList.Clear()
fillListView()
I think you want to clear the items from the list rather than the list. Most likey this first line is the problem as it will remove the columns and headers as well as any data in the list and afterwards additem methods with not show any data on screen.
I take it you have a sub routine to fill the list but you did not include that so this is all I can tell you.
Re: [Help] Listview won't refresh
Thanks DataMiser, that fixed it. It was kind of silly that I didn't notice that.
thanks again!