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.
I think the only way to get it to work completely is to parse the entire datawindow and either rewrite the syntax at runtime or change processing styles twice.. i think that will be too slow. determining all fields that share the same column will be slow regardless.
or abandon the grid entirely and build my own. that gets away from all the other unsolved problems in the grid, but is a lot of work to refactor into my application assuming it works well enough. I'd love to know if anyone has built their own grid that functions well.