PC Review


Reply
Thread Tools Rate Thread

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

 
 
=?Utf-8?B?RGF2ZSBXaWpheQ==?=
Guest
Posts: n/a
 
      22nd Feb 2004
Hi

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

Thanks in advanc
Dave
 
Reply With Quote
 
 
 
 
=?Utf-8?B?UmljaGFyZCBTYWRsZXI=?=
Guest
Posts: n/a
 
      22nd Feb 2004
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;
 
Reply With Quote
 
=?Utf-8?B?RGF2ZSBXaWpheQ==?=
Guest
Posts: n/a
 
      22nd Feb 2004
Yeap! It works. Thanks Richar

Dave
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to programmatically select items (rows) of a ListView in C#.NET? =?Utf-8?B?RGF2ZSBXaWpheQ==?= Microsoft Dot NET Framework 1 23rd Feb 2004 12:01 AM
How to programmatically select items (rows) of a ListView in C#.NET? =?Utf-8?B?RGF2ZSBXaWpheQ==?= Microsoft Dot NET 2 22nd Feb 2004 11:56 PM
Listview programmatically select item garrick Microsoft Dot NET Framework Forms 1 29th Nov 2003 11:10 PM
select item in listview programmatically Richard Bond Microsoft VB .NET 5 11th Sep 2003 05:16 PM
programmatically select a listview item...??? Richard Microsoft C# .NET 0 7th Jul 2003 11:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:52 AM.