|
-
January 6th, 2011, 08:53 AM
#1
[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.
-
January 6th, 2011, 09:16 AM
#2
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!
Last edited by Eri523; January 6th, 2011 at 10:26 AM.
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
-
January 6th, 2011, 09:46 AM
#3
Re: [Help] Listview won't refresh
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.
Always use [code][/code] tags when posting code.
-
January 7th, 2011, 03:08 AM
#4
Re: [Help] Listview won't refresh
Thanks DataMiser, that fixed it. It was kind of silly that I didn't notice that.
thanks again!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|