2 Replies - 41251 Views - Last Post: 02 January 2010 - 10:30 PM Rate Topic: -----

#1 cimpercee  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 127
  • Joined: 10-August 06

Listview Items and Subitems

Posted 27 April 2007 - 12:18 PM

heres a code on my form load event
  Me.EmployeesTableAdapter.Fill(Me.TechnoCallDataSet.Employees)
		Dim counter As Short
		Dim columnheader As ColumnHeader
		For counter = 0 To TechnoCallDataSet.Employees.Columns.Count - 1
			columnheader = New ColumnHeader
			columnheader.Text = TechnoCallDataSet.Employees.Columns(counter).ToString
			columnheader.TextAlign = HorizontalAlignment.Center
			columnheader.Width = 100
			ListView1.Columns.Add(columnheader)
		Next
Dim i as integer = 0
Dim lstitem as new listviewitem

listitem.text = Technocalldataset.employees.rows(i).tostring
for i = 1 to technocalldataset.employees.rows.count - 1
listitem.subitem.add(technocalldataset.employees.rows(i).tostring



well on this part i have 2 questions
first, when reading from database to Listview is it first column going down then row by row?

2nd. i cant display the rows only the header.but they seem to be the same.

thank you

Is This A Good Question/Topic? 0
  • +

Replies To: Listview Items and Subitems

#2 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: Listview Items and Subitems

Posted 27 April 2007 - 02:21 PM

Please use [code] [/ code] tags, with the space removed from between "/" and "c", when post your code.

The answer to your first question is Yes. When reading from a database it starts in the first column then goes across and then down to next row and repeats.

To answer your second question, will need to see the code for how you are building your ListViewItems. It doesn't look like you created the ListViewSubItems.

You might check the following link on how to populate a listview control.
Populating a ListView Control.
Was This Post Helpful? 0
  • +
  • -

#3 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2241
  • View blog
  • Posts: 9,412
  • Joined: 29-May 08

Re: Listview Items and Subitems

Posted 02 January 2010 - 10:30 PM

Update: Listview add subitems, more problems
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1