How to programmatically select items (rows) of a ListView in C#.NET?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

Does anybody know how to programmatically select items (rows) of a ListView in C#.NET

Thanks in advanc
Dave
 
He

Its quite simple all you do

// create a listvie
System.Windows.Forms.ListView lx = new System.Windows.Forms.ListView ()

//add a ro
lx.Items.Add (new ListViewItem ("Hello"))

// select the row at index 0 (in this case our row with hello as the text
lx.Items[0].Selected = true;
 
Back
Top