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.
jberndsen
Posts: 5
Joined: Fri Sep 07, 2018 10:09 am

Strange DataGridView issue

Post by jberndsen » Tue Sep 18, 2018 10:37 am

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: 5801
Joined: Thu Aug 18, 2011 4:56 am

Re: Strange DataGridView issue

Post by davidc » Tue Sep 18, 2018 10:55 am

[TOPIC MOVED TO POWERSHELL GUIS FORUM BY MODERATOR]
David
SAPIEN Technologies, Inc.

User avatar
jvierra
Posts: 13392
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Strange DataGridView issue

Post by jvierra » Tue Sep 18, 2018 11:03 am

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
Joined: Fri Sep 07, 2018 10:09 am

Re: Strange DataGridView issue

Post by jberndsen » Wed Sep 19, 2018 4:17 am

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

User avatar
jvierra
Posts: 13392
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Strange DataGridView issue

Post by jvierra » Wed Sep 19, 2018 4:23 am

What threading did you use. It has to be STA.

jberndsen
Posts: 5
Joined: Fri Sep 07, 2018 10:09 am

Re: Strange DataGridView issue

Post by jberndsen » Wed Sep 19, 2018 4:52 am

STA is currently what is in use.

User avatar
jvierra
Posts: 13392
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Strange DataGridView issue

Post by jvierra » Wed Sep 19, 2018 4:55 am

What host are you using? Does it match the installed version of PS on the remote system?

jberndsen
Posts: 5
Joined: Fri Sep 07, 2018 10:09 am

Re: Strange DataGridView issue

Post by jberndsen » Wed Sep 19, 2018 5:02 am

Yes, all computers have WMF 5.1 installed on them - Powershell 5.1.

User avatar
jvierra
Posts: 13392
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Strange DataGridView issue

Post by jvierra » Wed Sep 19, 2018 5:06 am

What hoist are you packaging with. You must pisck a compatible host.

jberndsen
Posts: 5
Joined: Fri Sep 07, 2018 10:09 am

Re: Strange DataGridView issue

Post by jberndsen » Wed Sep 19, 2018 5:16 am

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

Locked