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 4 years and 10 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.
I am trying to use ConvertTo-DataTable for my datagridview. I need to be able to sort the columns upon mouse click, this is the reason I have gone the route of ConvertTo-DataTable. Below is my working code, assume I have all the proper functions in an effort to keep the code short and understandable.. The $DT variable does not get filled for some reason, when I debug the program I notice it is blank..
The $results2 variable is still blank when I hover over it, although, my datagridview does still populate in my form with the message tracking logs, not sure where it's getting the data from if the $results2 variable is showing as blank in debug mode though, unless maybe it shows as blank by design?
Fair enough. I copied and pasted your code in, I had to add in the "Name = 'Job1' line btw. So now it runs as my previous code did, appears to give me the same result. I have attached a screen shot at the below link of my program with the loaded results.
It appears that it is ignoring my select statement, if you take a look at the columns in the datagrid, there are some listed that I do not even have in the select statement, not sure where they are coming from.
When I ran it without the "Name=Job1" line, it would continuously prompt me for the name, and if I left it blank, it would error out, so no, it was not optional. Here is the code I am using, line for line what you pasted above except added in "Name=Job1"
Disregard my previous post. I had an additional block code firing off in an "If" statement that was impacting this. My original code would have worked before I even posted here. Your solution does work though jvierra, thanks again.
This topic is 4 years and 10 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.