Results 1 to 5 of 5

Thread: Adding Item to a List view

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2007
    Location
    Wisconsin
    Posts
    81

    Resolved Adding Item to a List view

    I'm trying to add 5 columns of data to a list view.

    I've tried
    lstPortfolio.Items(Count).SubItems(1).Text = Ticker
    lstPortfolio.Items(Count).SubItems(2).Text = Convert.ToString(Shares)
    lstPortfolio.Items(Count).SubItems(3).Text = Convert.ToString(Price)
    lstPortfolio.Items(Count).SubItems(4).Text = Convert.ToString(Shares * Price)

    but I get an error telling me that Count is out of range - because there are no rows in the list view.

    I've also tried
    lstPortfolio.Items.Add(Ticker & Shares & Price & Shares * Price) but all that does is put the strings together, not in separate columns.

    I've come across a section that talks about adding an object class, but I'm HORRIBLE with getting classes to work
    Last edited by jrowe; Mar 4th, 2008 at 07:31 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width