Hi Kevin,
See
How do I add event code to Grid Controls built at run-time? FAQ #7967
>Hi, all...
>
>I could have sworn that I saw code for this years ago, but I'm not sure...
>
>I want to build a grid in VFP7 on the fly by using ADDCOLUMN. The columns aren't known until runtime. When each column is created, I want the click event of the column header to call a function [which sorts the grid on that column's controlsource]. Problem is, I don't know how to create a class for a grid column or grid heading.
>
>Is there a way around this?
>
--sb--