Page 1 of 1

Best Practise settings

PostPosted: Sat Dec 19, 2015 12:17 pm
by BRobinsonS
I need an opinion as to where it's best to set grid properties.
Should it be when app starts i.e. at Open Database or on page where the grid will be displayed?

I could extend this question to global variables too.

Re: Best Practise settings

PostPosted: Sat Dec 19, 2015 12:51 pm
by mishem
The properties of the grid can be set at any time.
You can also dynamically change the properties at the time when the table is already displayed.

Re: Best Practise settings

PostPosted: Sat Dec 19, 2015 2:37 pm
by Gaev
Brian:

I need an opinion as to where it's best to set grid properties.
Should it be when app starts i.e. at Open Database or on page where the grid will be displayed?

I would suggest that you place your dbpSetGridProperties command inside a Subroutine ... one for each "different grid style you would need to deploy" ... then, just before every dbpShowGrid, you can do a ...
Code: Select all
GoSub "DefineGridForTableX"
.. if a Table is shown with different style in different parts of the Application ...
Code: Select all
GoSub "DefineGrid1ForTableX"

The additional processing time for servicing this command multiple times will be negligible (unnoticeable by user) ... but will give you ease of management of styles during the life of an application.

I could extend this question to global variables too.

You could define and populate values for such variables in your Application's StartUp section ... then change them elsewhere as necessary.

Re: Best Practise settings

PostPosted: Sun Dec 20, 2015 7:00 am
by BRobinsonS
So done on Page Properties.
Therefore, don't need use ShowGrid for other pages on Startup?

Re: Best Practise settings

PostPosted: Sun Dec 20, 2015 11:17 am
by Wrangler
I like to show all my grids at startup. That way they are all sitting there ready until needed.