Moose Pickard

Moose Pickard

  • NA
  • 64
  • 70.4k

Problem getting selected item from ListView subcolumns

Oct 15 2010 5:03 AM
Hi

I've got a Listview with  4 colums. I constructed the following code from examples over the net. 
When I click the button it gives me ListViewItem: {Name of the car here, the first column}.
How can I get the subitems, in my case the Owner, Type etc. 
If you can help, please use my code if possible.

By the way, the way the selected item is displayed is that the only column that gets "blue" is the first one.
How could I make the whole row "blue"?

private void RentCarButton_Click(object sender,EventArgs e) {
ListView.SelectedListViewItemCollection sel = CarsLView.SelectedItems;
	foreach (ListViewItem item in sel){
	MessageBox.Show(item.ToString());
	}
}

Thank you

Answers (4)