Hi
How do i view data like this gui below in powershell studio? table with formatted headers?
GUI - Display data - table format - color? how?
Forum rules
Do not post any licensing information in this forum.
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 any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: GUI - Display data - table format - color? how?
Only two choices. Either use a RichTextBox control with custom output, use a DataGridView with custom painting and coloring or use ListView with custom building.
Re: GUI - Display data - table format - color? how?
There are really only three choices. Either use a RichTextBox control with custom output, use a DataGridView with custom painting and coloring or use ListView with custom building.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: GUI - Display data - table format - color? how?
You could generate HTML and use a browser view. But the control in the screenshot (.NET app) is most likely a Listview with groups.
A C# example is here: http://csharphelper.com/blog/2014/08/use-listview-groups-in-c/
Should be relatively easy to transfer.
A C# example is here: http://csharphelper.com/blog/2014/08/use-listview-groups-in-c/
Should be relatively easy to transfer.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: GUI - Display data - table format - color? how?
Ahh. yes. The web browser would also be quite easy. I missed that one. To get colored headers and other styles use a CSS style sheet.
The bigger issue is that the example shows a list and not a table. This may be a misuse of nomenclature and a list is what is required. If a table is really what you want then it would have one very wide row which would not be very useful visually. It is a table if you really do want to show a table of properties and values. My guess is that the control being used is a DataGridView. If that is true then you can just set the headers colors and make rows alternate colors for readability.
"ExportTo-Csv" can build a colorized list fairly easily.
The bigger issue is that the example shows a list and not a table. This may be a misuse of nomenclature and a list is what is required. If a table is really what you want then it would have one very wide row which would not be very useful visually. It is a table if you really do want to show a table of properties and values. My guess is that the control being used is a DataGridView. If that is true then you can just set the headers colors and make rows alternate colors for readability.
"ExportTo-Csv" can build a colorized list fairly easily.
Re: GUI - Display data - table format - color? how?
Thanks for all the feedback im looking into your suggestions
Re: GUI - Display data - table format - color? how?
Code: Select all
$button_search_Click={
Add-ListViewItem -ListView $listview_systeminfo -Items "Computer Name" -Group "General" -ImageIndex 0 -SubItems "General"
Add-ListViewItem -ListView $listview_systeminfo -Items "User" -Group "General" -ImageIndex 0 -SubItems "General"
Add-ListViewItem -ListView $listview_systeminfo -Items "Last Restart" -Group "General" -ImageIndex 0 -SubItems "General"
}
not getting the expected result want to format is like the exsample above.
Property;Value?
How do i provide the value with the property?
Re: GUI - Display data - table format - color? how?
Got a little further since I posted.
Is there a way to get the data in the listview
Want to make a button to export the data to a file