fmoore0001
asked on
Dynamically Change Foxpro Grids
Guys,
I have some clients who would like to be able to diynamically change our program, you know add remove columns, change width and column sizes, fonts sizes, etc.. I have some ideas on how to do this, but I was wondering if someone has already invented the wheel and posted an example somewhere of how to do this in the most efficient way.
Frank
I have some clients who would like to be able to diynamically change our program, you know add remove columns, change width and column sizes, fonts sizes, etc.. I have some ideas on how to do this, but I was wondering if someone has already invented the wheel and posted an example somewhere of how to do this in the most efficient way.
Frank
What you can do is provide dropdowns of the fields which they need to include in the grid and save that setting till the next time they open the same program.
You also need to write a script to take of alignment and size depending on field type and size.
You also need to write a script to take of alignment and size depending on field type and size.
The last time I created something like this within the display form itself I limited what the users could change to:
Which column's displayed
Column sequence
The users could readily move columns around and change the column size (including shut them off).
When the user left the form, these parameters were saved and used the next time the form was launched.
Obviously this approach worked on a 'form grid'-by-'form grid' basis and was not universally applicable across all grids in the application.
But, for those users, it satisfied 90+% of what they wanted and other things like:
Font
Size
Etc
were merely 'nice to have' features which, for them, wasn't worth doing.
But, as CaptainCyril says above, those other parameter settings can also be saved and used.
Implementing a means for user input to acquire those last parameters might be a little challenging, but it can be done. You could always use a separate User Configuration Definition form to acquire the user's preferences and then utilize those values whenever ANY grid is displayed in a Form.
Also recognize that the forms might originally display a little slower on the forms when implementing those changes since it generally takes a little extra time to sequence through all of the individual columns and implementing user settings such as display/no-display/column width/etc parameters.
Good Luck
Which column's displayed
Column sequence
The users could readily move columns around and change the column size (including shut them off).
When the user left the form, these parameters were saved and used the next time the form was launched.
Obviously this approach worked on a 'form grid'-by-'form grid' basis and was not universally applicable across all grids in the application.
But, for those users, it satisfied 90+% of what they wanted and other things like:
Font
Size
Etc
were merely 'nice to have' features which, for them, wasn't worth doing.
But, as CaptainCyril says above, those other parameter settings can also be saved and used.
Implementing a means for user input to acquire those last parameters might be a little challenging, but it can be done. You could always use a separate User Configuration Definition form to acquire the user's preferences and then utilize those values whenever ANY grid is displayed in a Form.
Also recognize that the forms might originally display a little slower on the forms when implementing those changes since it generally takes a little extra time to sequence through all of the individual columns and implementing user settings such as display/no-display/column width/etc parameters.
Good Luck
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Tusharkanvinde,
That was the answer. Neat class and gives my users near total control of the grid.
Knew there was something out there.
Frank
That was the answer. Neat class and gives my users near total control of the grid.
Knew there was something out there.
Frank
ASKER
One note for anyone who reads this. The www.sweetpotatosoftware.com site has a BUNCH of useful VFP classes and utilties, stuff worth downloading.
Ought to make a list up of such places.
Frank
Ought to make a list up of such places.
Frank
If that is what they want, then utilize an Excel worksheet object within a form.
But you can give the users a degree of flexibility within a VFP Grid, and then store the parameter changes.
Then, when the grid is next needed, VFP can access the stored parameters and modify the grid accordingly using those changes.
There are also grid 'tools'.classes/etc, out there that have been developed by others like ourselves to do much of what you want. Some creative Googling will likely find some worth looking at.
Good Luck