Windows Develop Bookmark and Share   
 index > Windows Forms General > creating rows in listview control
 

creating rows in listview control

The following is not printing out anything on the listview;

There are valid field values for PatientRecords but my listview syntax must be wrong.

I should have multiple rows with a FirstName LastName and VisitDate on the same row.

How should this code look different than what I have below?

And adding columns, that is using a detail view? How does that work?

Thank you. -hazz

Private genlst_PatientRecords As New List(Of clsPatient)

genlst_PatientRecords = CreatePatientInfoList(Me.TextBoxPatientID.Text)

For i = 0 To genlst_PatientRecords.Count - 1

Dim item As New ListViewItem(genlst_PatientRecords.Item(i).FirstName)

item.SubItems.Add(genlst_PatientRecords.Item(i).LastName)

item.SubItems.Add(genlst_PatientRecords.Item(i).VisitDate)

Next

hazz  Sunday, September 09, 2007 7:18 AM
You'll need View = Detail and add columns to make the sub-items visible. Right-click the ListView, choose Edit Columns and use the Add button.
nobugz  Sunday, September 09, 2007 2:19 PM
You'll need View = Detail and add columns to make the sub-items visible. Right-click the ListView, choose Edit Columns and use the Add button.
nobugz  Sunday, September 09, 2007 2:19 PM

Ahh! 1 minute of property changes with no code changes and that is it!

Thank you once again Hans!

Greg

hazz  Sunday, September 09, 2007 5:57 PM

You can use google to search for other answers

Custom Search

More Threads

• datagrid view event
• System ArgumentException in System.Drawing!!!
• C# Application Dies for Only 1 User
• Failed to load resources from resource file. Please check your setup
• font isn't similar in RICHTEXTBOX and LABEL ...also it doesn't appear good in all resolution
• Is using this.object (C#) or me.object (Vb)more efficient?
• Really need better component layout control.
• TreeView with CheckBoxes
• Create SQL Logins Using C#.net
• message passing between threads in c#