?
Solved

Select All in listview

Posted on 2000-02-14
12
Medium Priority
?
170 Views
Last Modified: 2010-04-04
how can i select all in listview with one click
0
Comment
Question by:esk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
12 Comments
 
LVL 5

Expert Comment

by:TheNeil
ID: 2518740
Can you use the OnClick method and simply select everything in that?

The Neil
0
 

Author Comment

by:esk
ID: 2518924
i want to push a button, after that it selects all in this listview
0
 

Author Comment

by:esk
ID: 2518927
this is like multiselect , but i push a button and it select self all item
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:Jaymol
ID: 2518972
Simple, but does what you asked for...

procedure TForm1.Button1Click(Sender: TObject);
var
  TmpI : Integer;
begin
  For TmpI:=0 to ListBox1.Items.Count-1 do
  ListBox1.Selected[TmpI]:=True;
end;

Hope this helps,

John.
0
 
LVL 6

Expert Comment

by:Jaymol
ID: 2518986
Doh!!!  Sorry.....You said listview, not listbox....

For TmpI:=0 to ListView1.Items.Count-1 do
ListView1.Items[TmpI].Selected:=True;
ListView1.SetFocus;

That'll do the trick!

John.
0
 
LVL 5

Accepted Solution

by:
TheNeil earned 200 total points
ID: 2518993
Create your button then add something along the lines of the following:

VAR
  iCount : INTEGER;
begin
  FOR iCount := 0 TO (ListView1.Items.Count - 1)
  DO
    ListView1.Items[iCount].Selected := TRUE;
  ListView1.SetFocus;
end;

The Neil
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2519003
p.s. Make sure you set the MultiSelect property of your TListView to TRUE else it won't work

The Neil
0
 
LVL 6

Expert Comment

by:Jaymol
ID: 2519018
Ha!  (Forgot to mention MultiSelect though!)

John.
0
 

Author Comment

by:esk
ID: 2519258
work!!!
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2519289
Thanks Esk,

Sorry John - looks like I won this time

The Neil
0
 
LVL 6

Expert Comment

by:Jaymol
ID: 2522175
This is pathetic.  I'm getting pissed off with you so called Experts.
0
 
LVL 6

Expert Comment

by:Jaymol
ID: 2522179
Who answered you first?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question