Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / January 2008

Tip: Looking for answers? Try searching our database.

How to select items in a ListView control through code?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrew - 28 Jan 2008 15:48 GMT
Hello, friends,

I tried to select all the items using (c#.net):

       private void ButtonSelectAll_Click(object sender, EventArgs e)
       {
           for (int i = 0; i < this.ListViewPageNumber.Items.Count; i++)
           {
               this.ListViewPageNumber.Items[i].Selected = true;
           }
       }

where the property HideSelection was set to false at design time.

However, I could NOT see the items being selected (normally in blue color).
although I had no problem to select multiple items using mouse or keyboard.
This control is really weired.

Any ideas? Thanks.
Andrew - 28 Jan 2008 23:37 GMT
Hi, friends,

It DID select the items I wanted, and showed the selected items in a light
grey color. However, this color was so light that it was very hard to tell
from form's background color.

Any property that will allow us to change this color? I tried to find it in
propery box, but failed.

Thanks a lot.

This ListView control is really weired.

> Hello, friends,
>
[quoted text clipped - 15 lines]
>
> Any ideas? Thanks.
Claes Bergefall - 29 Jan 2008 11:27 GMT
Unfortunately there is no way to change it (unless you want to draw the
items yourself). When the listview has focus they will show up in blue,
otherwise they will be gray.

  /claes

> Hi, friends,
>
[quoted text clipped - 31 lines]
>>
>> Any ideas? Thanks.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.