I have made in Powershell Studio 2014 a ListView with 7 items (2 items are selected by Default)
Now I have a radio button (Name: Select all). How can I configure this radio button to select all items in the ListView?
Variable names:
Radio button: rbSelectAllExtensions
ListView: lstWordExtensions
Thank You in advance for help....
Pascal Bilat
Powershell Studio 2014 - ListView and Radio Button question
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- SAPIEN Support Forums
- Posts: 945
- Last visit: Thu Oct 22, 2015 1:10 pm
Powershell Studio 2014 - ListView and Radio Button question
This is an automated post. A real person will respond soon.
Thank you for posting, postmaster@bilat.ch.
Did you remember to include the following?
*** Make sure you do not post any licensing information ***
Thank you for posting, postmaster@bilat.ch.
Did you remember to include the following?
- 1. Product, version and build (e.g. Product: PowerShell Studio 2014, Version & Build: 4.1.71. Version and build information can be found in the product's About box accessed by clicking the blue icon with the 'i' in the upper right hand corner of the ribbon.)
2. Specify if you are running a 32 or 64 bit version
3. Specify your operating system and if it is 32 or 64 bit.
4. Attach a screenshot if your issue can be seen on the screen
5. Attach a zip file if you have multiple files (crash reports, log entries, etc.) related to your issue.
*** Make sure you do not post any licensing information ***
- Alexander Riedel
- Posts: 8478
- Last visit: Tue Mar 26, 2024 8:52 am
- Been upvoted: 37 times
Re: Powershell Studio 2014 - ListView and Radio Button quest
You do not use a radio button for this type of activity. Radio buttons are used to select one of multiple, mutually exclusive items.
For a "Select all" functionality you would usually use a simple push button.
For a "Select all" functionality you would usually use a simple push button.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Powershell Studio 2014 - ListView and Radio Button quest
Hello Alexander,
Thank You for your answer. A simple push button. OK, I will give it a try.
But what about the code for this push button? Do You have an example for selecting all items over a push button=
Pascal Bilat
Thank You for your answer. A simple push button. OK, I will give it a try.
But what about the code for this push button? Do You have an example for selecting all items over a push button=
Pascal Bilat
Re: Powershell Studio 2014 - ListView and Radio Button quest
To select all the items, you have to set the Select property to $true for each item:
http://www.sapien.com/blog/2012/04/04/s ... ol-part-1/
David
PowerShell Code
Double-click the code block to select all.foreach ($item in $listview1.Items) { $item.Selected = $true }I recommend reading the spotlight article on the ListView:
http://www.sapien.com/blog/2012/04/04/s ... ol-part-1/
David
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Powershell Studio 2014 - ListView and Radio Button quest
Hello David,
Thank You for your Suggestion. I have created a button "Select all" and tried the following code..
$btnSelectAll_Click={
#TODO: Place custom script here
foreach ($item in $lstWordExtensions.Items)
{
$item.Selected = $true
}
}
but it's not running?! And Yes, I have read and downloaded all Spotlight article and other stuffs/examples from Sapien.
Pascal
Thank You for your Suggestion. I have created a button "Select all" and tried the following code..
$btnSelectAll_Click={
#TODO: Place custom script here
foreach ($item in $lstWordExtensions.Items)
{
$item.Selected = $true
}
}
but it's not running?! And Yes, I have read and downloaded all Spotlight article and other stuffs/examples from Sapien.
Pascal
Re: Powershell Studio 2014 - ListView and Radio Button quest
Are you getting an error message?
Also make sure you have the ListView's MultiSelect property set to True.
David
Also make sure you have the ListView's MultiSelect property set to True.
David
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Powershell Studio 2014 - ListView and Radio Button quest
Hi davidc,
I have found the Problem with my code. Now it's running. I had to Change the code from item.Selected to item. I have changed the Radio button to a simple button as You explain me.
Example:
$btnSelectAllDocTypes_Click= {
# Click will select all items on Word Extensions Types to scan in ListView
foreach ($item in $lstWordExtensions.Items)
{
$item.Checked = $true
}
}
$btnUnselectDocTypes_Click={
# Click will unselect all items on Word Extensions Types to scan in ListView
foreach ($item in $lstWordExtensions.Items)
{
$item.Checked = $false
}
}
$btnSelectAllDocProps_Click={
# Click will select all items on Microsoft Word Document Properties in ListView
foreach ($item in $lstWordProperties.Items)
{
$item.Checked = $true
}
}
$btnUnselectDocProps_Click={
# Click will unselect all items on Microsoft Word Document Properties in ListView
foreach ($item in $lstWordProperties.Items)
{
$item.Checked = $false
}
}
That's great. Thank You very much
Pascal Bilat
I have found the Problem with my code. Now it's running. I had to Change the code from item.Selected to item. I have changed the Radio button to a simple button as You explain me.
Example:
$btnSelectAllDocTypes_Click= {
# Click will select all items on Word Extensions Types to scan in ListView
foreach ($item in $lstWordExtensions.Items)
{
$item.Checked = $true
}
}
$btnUnselectDocTypes_Click={
# Click will unselect all items on Word Extensions Types to scan in ListView
foreach ($item in $lstWordExtensions.Items)
{
$item.Checked = $false
}
}
$btnSelectAllDocProps_Click={
# Click will select all items on Microsoft Word Document Properties in ListView
foreach ($item in $lstWordProperties.Items)
{
$item.Checked = $true
}
}
$btnUnselectDocProps_Click={
# Click will unselect all items on Microsoft Word Document Properties in ListView
foreach ($item in $lstWordProperties.Items)
{
$item.Checked = $false
}
}
That's great. Thank You very much
Pascal Bilat
- Attachments
-
- Printscreen button Select all
- Button-Select all clicked.jpg (260.13 KiB) Viewed 3828 times