Strange DataGridView issue

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 5 years and 6 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.
Locked
jberndsen
Posts: 5
Last visit: Wed Nov 16, 2022 8:24 am

Strange DataGridView issue

Post by jberndsen »

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: Powershell Studio 2018, 5.5.154
32 or 64 bit version of product: 64 bit
Operating system: Windows 10
32 or 64 bit OS: 64 bit

*** Please add details and screenshots as needed below. ***

DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM

I'm having a strange issue with a script I've moved to Powershell Studio from another script. The script has a single text box for input, a button to submit and a DataGridView to display the results.

When I run the application on my computer (EXE and installed MSI) it works as designed. When I run the application on my laptop the script connects to the back-end and displays the form. When you enter data into the form and submit it the DataGridView never populates with anything. Both computers are running Windows 10 64 bit and have the same versions of .NET installed.

Any help would be appreciated!
Jeff
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Strange DataGridView issue

Post by davidc »

[TOPIC MOVED TO POWERSHELL GUIS FORUM BY MODERATOR]
David
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Strange DataGridView issue

Post by jvierra »

Unfortunately without a simple example of your code there is no way to guess at the issue.

It is likely that the code is not retuning any information that can be displayed. Place trace statements in your code. Rin the script on the laptop to test that the script actually works on that configuration.
jberndsen
Posts: 5
Last visit: Wed Nov 16, 2022 8:24 am

Re: Strange DataGridView issue

Post by jberndsen »

I copied the code and pasted it into the Powershell ISE and ran it - it displayed the data I was looking for. I then ran the EXE and MSI files and neither one of them displayed anything. Mind you, I have not changed anything in regards to the code, it just doesn't appear to work when packaged. I can post the entire script if you would like, but I know it works on some computers and not others.

Thanks!
Jeff
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Strange DataGridView issue

Post by jvierra »

What threading did you use. It has to be STA.
jberndsen
Posts: 5
Last visit: Wed Nov 16, 2022 8:24 am

Re: Strange DataGridView issue

Post by jberndsen »

STA is currently what is in use.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Strange DataGridView issue

Post by jvierra »

What host are you using? Does it match the installed version of PS on the remote system?
jberndsen
Posts: 5
Last visit: Wed Nov 16, 2022 8:24 am

Re: Strange DataGridView issue

Post by jberndsen »

Yes, all computers have WMF 5.1 installed on them - Powershell 5.1.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Strange DataGridView issue

Post by jvierra »

What hoist are you packaging with. You must pisck a compatible host.
jberndsen
Posts: 5
Last visit: Wed Nov 16, 2022 8:24 am

Re: Strange DataGridView issue

Post by jberndsen »

Wow I feel stupid. I packaged the app as a 32 bit application and it ran on my 64 bit development computer, when I ran the 32 bit app on my 64 bit laptop it didn't. When I packaged the app as a 64 bit app it started working on the laptop.

Sorry and thank you for your help!
Jeff
This topic is 5 years and 6 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.
Locked