Support Forums

Create a data GridView, select single/multiple rows and execute something

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.
User avatar
ramses147
Posts: 67
Joined: Fri Sep 16, 2016 4:27 am

Create a data GridView, select single/multiple rows and execute something

Postby ramses147 » Thu May 18, 2017 7:46 pm

Hi guys,

i'd like to:

1- create a simple gridview from a csv file like this in attachment
2- then i would like to select one or multiple rows
3- save each value row in a variable, for example $computername=A2 $localaccount=B2 DomainAccount=C2
4- use a button to do something, for example write-host $computername $localaccount DomainAccount

is it possible ?
Attachments
Cartel1 - Excel000690.jpg
Cartel1 - Excel000690.jpg (31.25 KiB) Viewed 56 times
User avatar
jvierra
Posts: 10816
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Create a data GridView, select single/multiple rows and execute something

Postby jvierra » Thu May 18, 2017 7:52 pm

Import-Csv myfile.csv | Out-GridView

help Out-GridView -Full
User avatar
ramses147
Posts: 67
Joined: Fri Sep 16, 2016 4:27 am

Re: Create a data GridView, select single/multiple rows and execute something

Postby ramses147 » Sat May 20, 2017 6:34 am

Thanks Jvierra !

Return to “PowerShell GUIs”

Who is online

Users browsing this forum: No registered users and 1 guest