Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bindevent and Grid Columns
Message
De
27/05/2010 17:49:20
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Bindevent and Grid Columns
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01466311
Message ID:
01466311
Vues:
172
I inherited a custom grid class. The definition of the grid shows a ColumnCount of 30. Three methods of EACH column in the grid have code in them.


The MouseDown code for the Header of each column is
LPARAMETERS nButton, nShift, nXCoord, nYCoord
This.Parent.Parent.origcolnum = this.Parent.ColumnOrder
The Click code for the Header of each column is
IF this.Parent.Parent.origcolnum = this.Parent.ColumnOrder
	this.Parent.parent.SortGrid(this.Parent)  
ENDIF
The DblClick code for the TextBox inside each column is
this.Parent.Parent.filtercolumn=this
this.parent.parent.DblClick()
We've run into a situation where the ColumnCount for the grid needs to expand beyond 30 columns. Our "solution" is to expand the numbe of columns (to 50) and put this code into each new column's header/text box. This solution works and is therefore, by our definition, acceptable and has been implemented.

OTOH, it seems to me that there should be a better solution by taking all this code out of the column header and text box and somehow using BINDEVENT() to get everything working. I don't have enough familiarity with BINDEVENT to do this and my (admittedly meager) efforts have been fruitless.

Could somebody please provide some guidance on

1. Is BINDEVENT a reasonable way of attaching code to the header/textbox of each column in the grid

2. Coding technique for actually getting it done

3. If the form reduces ColumnCount and later expands it, will all the columns still be "bound"

4. If not is there an _ASSIGN method (or something else that doesn't have to be coded in the application) for ColumnCount where I can rebind all the columns?

I hope this is comprehensible.........

Thanks to all.............Rich
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform