Search found 12901 matches

by jvierra
Fri Nov 16, 2018 4:10 pm
Forum: PowerShell GUIs
Topic: Export Datagridview to CSV
Replies: 11
Views: 325

Re: Export Datagridview to CSV

Just add rows to the DataTable as you need. Once bound to the grid they will show automatically. I have used a grid for a dynamic logger and to dynamically display the results of a job as they arrived.
by jvierra
Fri Nov 16, 2018 2:11 pm
Forum: PowerShell GUIs
Topic: GUI - Display data - table format - color? how?
Replies: 47
Views: 1091

Re: GUI - Display data - table format - color? how?

That is the same code I asked you to turn into an object collection. Now just convert the collection to a DataTable or change it to create a DataTable. Create the table and columns and add each item to the table as a row. $dt.Rows.Add($property, $value, $group) Add the DataTable to the DGV DataSourc...
by jvierra
Fri Nov 16, 2018 1:35 pm
Forum: PowerShell GUIs
Topic: Export Datagridview to CSV
Replies: 11
Views: 325

Re: Export Datagridview to CSV

You need to start with a DataTable. Why is that so hard? Just convert your object collection to a DataTable.

Post the code that loads your grid and I will give you an example.
by jvierra
Fri Nov 16, 2018 1:19 pm
Forum: PowerShell GUIs
Topic: Export Datagridview to CSV
Replies: 11
Views: 325

Re: Export Datagridview to CSV

See the following example:
by jvierra
Fri Nov 16, 2018 1:17 pm
Forum: PowerShell GUIs
Topic: Export Datagridview to CSV
Replies: 11
Views: 325

Re: Export Datagridview to CSV

No. You need to bind the table when you load the grid. Why is that a problem?
by jvierra
Fri Nov 16, 2018 12:33 pm
Forum: PowerShell GUIs
Topic: Export Datagridview to CSV
Replies: 11
Views: 325

Re: Export Datagridview to CSV

You have to load the grid from a DataTable in order to have a "data bound" row.
by jvierra
Fri Nov 16, 2018 3:40 am
Forum: PowerShell GUIs
Topic: GUI - Display data - table format - color? how?
Replies: 47
Views: 1091

Re: GUI - Display data - table format - color? how?

Here is a cleaner way to access groups using your code: $groups = @{ 'General' = 'Computer Name,Last Restart' 'Build Info' = 'Manufactorer,Model,Name' 'Operating System' = 'OS,Service Pack,Version,OS Architecture,Install Date' 'Hardware' = 'CPU,RAM,HD[1],HD[2],HD[3],HD[4],HD[5],HD[6],HD[7],HD[8],HD[...
by jvierra
Fri Nov 16, 2018 2:40 am
Forum: PowerShell GUIs
Topic: GUI - Display data - table format - color? how?
Replies: 47
Views: 1091

Re: GUI - Display data - table format - color? how?

Note also that the PSF you posted above des show in groups. Your method does work so I am at a loss to understand what the issue is. That is about the only two ways to create a grouped output.

A TreeView can also display in groups.
by jvierra
Fri Nov 16, 2018 2:33 am
Forum: PowerShell GUIs
Topic: GUI - Display data - table format - color? how?
Replies: 47
Views: 1091

Re: GUI - Display data - table format - color? how?

Everywhere you have one of these: $sysinfo.Add("Computer Name", "$($sysCompp.PSComputerName)") You need to do this: [pscustomobject]@{ Name = 'Computer Name' Value = $sysCompp.PSComputerName Group = 'Operating System' # or what ever group you want it in. } In the end a ListView is not designed to do...
by jvierra
Fri Nov 16, 2018 2:20 am
Forum: Windows PowerShell
Topic: Create Service
Replies: 4
Views: 321

Re: Create Service

You will have to place a request for a new feature with Sapien here: https://www.sapien.com/requests