>I've have a grid that displays 3 fields:
>
>Description Due Date Completion Date
>
>I've created a method that calculates the number of days 'til the completion date. I'd like to fire that method for every record in the grid. Where would I call the method from? On init of page or THISFORM.Grid1.Column3.Text1?? And how can I determine what row I'm in on the grid, I'd like to change the color of the grid line of the selected record.
>
>TIA!
>
>/Chris
Chris,
Another way you could do what you're after would be to drive your grid from a view, and put the calculations in the SQL code for the view. If you don't need to persist the data, that would allow you to quickly perform those calculations on the table as you open the view.
To get the best of both worlds, you could create a procedure file (To keep this strictly FoxPro) and call the user defined function to perform those calculations.
For example,
Set Procedure To myProcedureFile
Select description as description, ;
CalcDueDate() As DueDate, ;
From mytable ;
Into Cursor curMyResults
By creating a view, you make it easier to manage in a grid and handle updating the original table.
Regards,
Jason
Jason Tryon
Senior Systems Analyst / Technical Lead
eBusiness / iPage