>>>Hi All,
>>>
>>>I have a form with a grid. I am programmatically adding columns to the grid using AddObject(). Is there a way to also add some custom code to the header click event of the column I am adding in this way?
>>
>>Bindevent.
>
>Thanks Tore. I can see how to do it but am concerned about this - the user may create many copies of the form I am building, each form's grid can have many columns, each column of each grid on each form would require a bindevent. I am not sure thats a good idea ?
Bindevent is actually very lightweight - it's just an entry in some internal table somewhere - and it's only telling Fox when to run some code. While I don't have much of multiple instances of the same form, I got lots of bindevents on grid headers, grids, and in some cases, at least two or three on each of some 200 controls spread across a 8-page pageframe within the last page of a 9 page pageframe, and it just works and doesn't complain.