Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding Click Events to Grid Headers
Message
De
09/12/1999 16:39:24
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00301307
Message ID:
00301322
Vues:
23
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?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform