datagridview goes crazy

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 8 years and 1 month 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
User avatar
monoeagle
Posts: 108
Last visit: Fri Jan 26, 2024 10:44 am

Re: datagridview goes crazy

Post by monoeagle »

öhmm

what dependencies?

The xml files will be created if they don't exist and also the DIRs.

The projectfiles where on my Client at DIR: C:\Workbench\Projects\ViSiT_Final
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: datagridview goes crazy

Post by jvierra »

All of the files are empty.
User avatar
monoeagle
Posts: 108
Last visit: Fri Jan 26, 2024 10:44 am

Re: datagridview goes crazy

Post by monoeagle »

I don't understand what dependencies on my client exist what is not in the export.
I can run the generated exe on another client an get the behaviour too.

rename zip to exe, there is a filter for exe files
Last edited by monoeagle on Thu Jan 28, 2016 3:07 pm, edited 1 time in total.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: datagridview goes crazy

Post by jvierra »

When I try to load the DGV I get nothing an no error. It is trying to load entries.xml and that file has no entries.
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <inhalt>
  3.   <elements>
  4.   </elements>
  5. </inhalt>
User avatar
monoeagle
Posts: 108
Last visit: Fri Jan 26, 2024 10:44 am

Re: datagridview goes crazy

Post by monoeagle »

At first the entries.xml is empty.

Over the testing menu it is possible to add entries in the first post are the screenshots attached.
The testmenu is just for testing if the functions works. Later the content will be automated.

xml with two entries:
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <inhalt>
  3.   <elements>
  4.     <Entry Number="1">
  5.       <number>1</number>
  6.       <typ>VM</typ>
  7.       <baureihe>BR402</baureihe>
  8.       <version_lokal>V17.22</version_lokal>
  9.       <datum_lokal>12.10.2015</datum_lokal>
  10.       <version_ablage>V17.22</version_ablage>
  11.       <datum_ablage>12.10.2015</datum_ablage>
  12.       <pfad_lokal>C:\VMs\VM\BR405_150921_XP</pfad_lokal>
  13.       <pfad_ablage>Z:\VMs\VM\BR405_150921_XP</pfad_ablage>
  14.       <hash_lokal>
  15.       </hash_lokal>
  16.       <hash_ablage>
  17.       </hash_ablage>
  18.     </Entry>
  19.     <Entry Number="2">
  20.       <number>1</number>
  21.       <typ>VM</typ>
  22.       <baureihe>BR402</baureihe>
  23.       <version_lokal>V17.22</version_lokal>
  24.       <datum_lokal>12.10.2015</datum_lokal>
  25.       <version_ablage>V17.22</version_ablage>
  26.       <datum_ablage>12.10.2015</datum_ablage>
  27.       <pfad_lokal>C:\VMs\VM\BR405_150921_XP</pfad_lokal>
  28.       <pfad_ablage>Z:\VMs\VM\BR405_150921_XP</pfad_ablage>
  29.       <hash_lokal>
  30.       </hash_lokal>
  31.       <hash_ablage>
  32.       </hash_ablage>
  33.     </Entry>
  34.   </elements>
  35. </inhalt>
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: datagridview goes crazy

Post by jvierra »

So what is it that does not work? How do we make it ail?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: datagridview goes crazy

Post by jvierra »

Well so far so good. I added entries and have a grid. How do I make it fail?
User avatar
monoeagle
Posts: 108
Last visit: Fri Jan 26, 2024 10:44 am

Re: datagridview goes crazy

Post by monoeagle »

The fail is reproduced(as described in the threadstart with the screenshots) on my side with the following:

- empty xml
- add xml entry via testing menu
- fill the dgv with the xml

if I use this steps in a row I get the first row in the dgv where in every cell is just 1 char.
If I clean the dgv and reload the xml via the testing menu the dgv display is correct. if I remove the entries in the xml and add a new xml entry and will load this new try the first row is faulty.

I think the problem is on the xml side or a problem with the xml in the memory?

But the Stepfunktions of PSS always show me the correct values in the variables. ;(

I read about that this behaviour(just 1 char in a cell) will be there if DirtyStateChanged is used.
  1. $datagridview_main_CurrentCellDirtyStateChanged={
  2.     if ($datagridview_main.IsCurrentCellDirty)
  3.     {
  4.         $datagridview_main.CommitEdit([System.Windows.Forms.DataGridViewDataErrorContexts]::Commit)
  5.     }
  6. }
But I got the same behaviour if I commend it out or delete it.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: datagridview goes crazy

Post by jvierra »

I have not recreated you issue. How many rows is "fill the DGV"?
User avatar
monoeagle
Posts: 108
Last visit: Fri Jan 26, 2024 10:44 am

Re: datagridview goes crazy

Post by monoeagle »

step 4 result - WRONG VIEW.png
step 4 result - WRONG VIEW.png (12.17 KiB) Viewed 3354 times
fill the dgv is 1 row enough. But if you have entries in the xml you have to delete the entries in the xml manually, because at the moment I don't have the del function for the xml file in the testing menu.

Did you see the screenshot from the beginning with the 1 char in every field?
This topic is 8 years and 1 month 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