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.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 2 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Product: PowerShell Studio 2021 (64 Bit)
Build: v5.8.195
OS: Windows 10 Pro (64 Bit)
Build: v10.0.19043.0
Hello all,
I have a listview with checkboxes that is filled by an xml-file. Listview has items and subitems. Depends on what is checked, the attributes from active directory will be load to a datagridview and also when I change the items, the datagridview gets the updated items.
1.png (5.21 KiB) Viewed 2298 times
2.png (3.45 KiB) Viewed 2298 times
This is working fine for now. What I try to do is, to change the column headers to the subitems from the listview (sn should be Lastname, givenName should be Firstname and so on)
You are specifying that the columns are the properties of the object retrieved. Those will be the column headers. Don't select properties you don't want. You can also use a computed "Select-Object" to reassign names to any property.
My best guess is that you either inherited the code or copied it from the Internet. Look at how the ListView is built and you will see how the "DisplayName" of the properties was acquired.
Use the computed select to create aa column with the display name instead of the property name.
I only want to have the item.subitems.text in the datagridview because this is more userfriendly to see for what this attribute is used for (extensionAttribute1 is use for laboratory users for example).
When you talk about "computed select" you mean "calculated properties"?
When I swap item.text with item.subitems then the Get-ADUser will not work anymore.
First you need to learn how to use things like the debugger. Next take some time to learn about how the controls work.
Yes. "Calculated properties" which are also referred to as "computed" properties since the words "computed" and "calculated" are pretty much identical in meaning.
This topic is 2 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.