Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Click Events to Grid Headers
Message
From
09/12/1999 16:39:24
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00301307
Message ID:
00301322
Views:
22
Hi Jeff,

>I have a grid on a form that I pass parameters to create the header names and control source for the columns. The grid is dynamic in that it can contain as many columns as it will handle. The problem is that I want to add a sort routine to the headers' click events so that the user can sort by clicking on the column header. But, I cannot see how to dynamically add the code to the click event (at runtime).

Create a header class (done in code) and add that to your columns. To make this header reusable so only one class needs to be defined, put this code in its Click method:

This.Parent.Parent.HeaderClicked(This)

Then you can put the code for the individual headers in the grid instance, or a class, or anything. Very nice. Make Sense?
Previous
Reply
Map
View

Click here to load this message in the networking platform