Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
445
Reload a grid layout after resetting the columns for the bands
posted

Hello!

I am having an issue that I can't explain and I hope you can.

I have hard coded a default layout for all users. When a user closes a form that a grid is on, the current grid layout is stored in the database and loaded the next time the users opens the form. I give the users the option (via a menu option) to reload the default layout. I do this by deleting record for the users layout, then call resetcolumns on each band in the grid (most grids only have one band) and then call the code to set the default layout.The code to reset the default layout has a call to the load from database routine but since no record exists is sets the default layout (column visibleposition, hidden and ExcludeFromColumnChooser properties). This works great (thanks to all who posted with this code).

We are changing the code to allow administrative users the ability to save a default layout for all users. I have added code to check to see if the user has a layout saved, if not, it tries to load the default saved by the administrator. This works great when the user does not have a saved layout and the form is loaded for the first time. The admins default layout loads without issue.

Here is my problem, when the user has a saved layout and they choose to reset the layout, I run through the code to reset to the saved default layout (delete the users layout, resetcolumns, load default from database). It does not appear that the load from the database happened at all. All columns are visible and in the order of the data.