DataGridView

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 6 years and 9 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
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: DataGridView

Post by jvierra »

If you select compatibility to V2 then it will use V2 assemblies and they need to be specified in the options.

I just found an anomaly in PSS 141. If I create and run a simple form with V5/64 and look at the code it loads the Net 4.0 assemblies. If I then set the PSF to run V2/64 it loads the Net 2.0 assemblies in the code. If I switch back to V5 the code continues to load only V2 assemblies.

David. Is this supposed to happen?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: DataGridView

Post by jvierra »

Yup! Once we build for V2 the assemblies are never updated if switching to a newer PS version.

There must be a way to force the assemblies to update to the requested version.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: DataGridView

Post by jvierra »

To allow the assemblies to follow the platform selections just clear the designer option for "Enable PowerShell V2 assembly compatibility". This will prevent the degradation to V2 assemblies when selecting newer platforms.

It does appear that the workflow for the build has a bug in that it chooses the current platform and inserts the newer assemblies even when that option is selected and only forces V2 assemblies if you switch to V2 and back. I don' think this was the intention.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: DataGridView

Post by davidc »

There is a compatibility mode that you can disable (Options->Designer->Enable V2 assembly compatibility):
Enable V2 compatibility.png
Enable V2 compatibility.png (25.02 KiB) Viewed 1617 times
Without the option checked, it will use the .NET 4.0 versions of the assemblies.
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: DataGridView

Post by jvierra »

Now that I have toggled that setting on an d off it is correctly creating forms with 2.0 assemblies when set and 4.0 when not set. Originally it was set and a bew form would still use 4.0 until I changed the platform to PS v2 and back.

Strange?!?

The 141 update trashed PSS and forced me to uninstall and re-install it to get anything outside of the editor to work. I didn't manually clean up the residual files and registry entries so something my have been broke.
This topic is 6 years and 9 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