Multi column list control – the best choice

Hello

I’ve just started programming in VB.Net in Visual Studio having done lots of VBA.

I’d like to display a multi column list on my form.  I’d like to display files and their attributes:

Filename                             Album          Artist                     Track number
Nine Lives – Crash.mp3       Nine Lives          Aerosmith              3

Which is the best control to do this?

A ListBox appears to be able to store only one field of data – MultiColumn seems to mean displaying a single field of data down then across – with no vertical scroll bars, only horizontal

A ListView seems to be the best option.  I can populate it, but I can’t seem to “get” any values from it.  I can get the selected index number, but not the values.

Any pointers would be appreciated.

Thanks
LVL 3
IainTheVBALearnerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jobrienctCommented:
Datagrid would probably be most appropriate for this.

heres a tutorial, have a look.

http://www.codeproject.com/vb/net/grid101.asp

John

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jobrienctCommented:
If you want to use a listview then heres a snippet to get you started reading values:

   For Each row As ListViewItem In myListView.Items
      For Each column As ListViewItem.ListViewSubItem In row.SubItems
         MsgBox(column.Text)
     Next column
  Next row

In this way you can see the relationship between a listview and a coordinate grid or spreadsheet where it can behave as rows and columns and your values are the intersection.

JOhn
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.