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

G

Guest

Hi

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

Thanks in advanc
Dave
 
G

Guest

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;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top