Hi all,

I've created two columns on the list view as follows.

ColumnHeader colHed;

		// Header one
			colHed = new ColumnHeader();
			colHed.Text = "Name";
			colHed.Width = 100;
			this.lwDetails.Columns.Add(colHed);

		// Header two
			colHed = new ColumnHeader();
			colHed.Text = "Address";
			colHed.Width = 200;
			this.lwDetails.Columns.Add(colHed);

Then on a separate function I try to add data to those columns. Name and address of a one person store in a string array named items. I try to add data as follows.

this.lwDetails.Items.Add(items[0]);
			this.lwDetails.Items.Add(items[1]);

lwDetails is the list view. In this case name and address are added to the same column. How can I correct it.

Thanks..

Anyway, I solved it myself after doing some experimental. Just have to followed SubItems on the ListView.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.