CB
Clay Burch
Syncfusion Team
August 16, 2002 07:51 AM UTC
To get the clicked row, you can use the SelectedItems collection and look at th eIndex of the first item in that collection.
//C#
int selectedRow = listView1.SelectedItems[0].Index;
'VB.NET
Dim SelectedRow as Integer = listView1.SelectedItems(0).Index
To add a new item, you first create, and them call the Items.Add member of the ListView. This code adds a 4 column items
ListViewItem newitem = new ListViewItem("new - 0",1);
newitem.SubItems.Add("new - 1");
newitem.SubItems.Add("new - 2");
newitem.SubItems.Add("new - 3");
listView1.Items.Add(newitem);