allowing a user to move/resize columns is the main (only?) reason to use a grid dw.
users EXPECT the system to remember their grid settings, and also expect a way to restore the original layout. pretty much a standard of software since the mid 90s.
PB datawindow settings of a grid are complete garbage. Set the x and width of a grid field and sometimes it works and often it doesnt'.
Use the visible property to hide everything and then turn it back on works much better, but you have to restore the visible property AND expression in case you had an expression. The PFC uses this method to sort of restore the grid field positions (it mostly works).
BUT - if you have a compute field in the footer of the grid and that field has a visible expression on it, then it stays invisible if you use the visible setting method of column restores. This is a known bug, never fixed. Regardless, this is only an issue because setting the X value method DOES NOT WORK. The kicker is that powerserver 2020 and prior versions works properly with the visible setting. I assume it won't in PS2021.
setting the x value of a grid should work. period. end of story. but it doesn't. I'm tired of revisiting these same bugs over and over and over again.
Long time ago it was recommend on the old forums to simply not use a grid datawindow because of these problems. Instead it was recommended to build your own grid like datawindow using lines and then do a lot of powerscript to get it to work like a grid. Has anyone done this, and is it worth doing?
the other option might be to rebuild the syntax of the datawindow at run time rather than do a bunch of modifies. That also is a lot of work, but may in fact be the only answer.
I know several applications just use the brute force approach and store the entire datawindow just to save the grid positions, but that seems like so much overkill to get around unfixed bugs. Plus you would also have to manage any changes to the datawindow in new versions of your system.
FYI: I now have working prototype code in my STD Framework that performs a full Grid DWO save/restore between Open/Close and App restarts. This preserves *all* the grid column locations, grid line sizes, fonts, filters, sorts, etc as per *all* the App user's mouse actions against the DWO.
I did all this in two basic lines of code - but of course, it will need more to properly implement a robust feature - but I know know that it's possible, simple, foolproof (I hope - LOL), etc to implement . ;-)
I hope to release this in the next STD Framework beta for PB/PS2021 beta very soon. he hardest part will be System-To-System controls and also to fallback to the original DWO if required. ;-)
Regards ... Chris
Yes, this feature was released in the 2021.4.0.258 Major Release (2021R4) version of the framework! :-)
FYI: http://chrispollach.blogspot.com/search?q=2021R4
HTH
Regards ... Chris