Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bindevent and Grid Columns
Message
De
28/05/2010 08:42:59
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
27/05/2010 17:49:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01466311
Message ID:
01466362
Vues:
47
You don't need BindEvent(). This was doable in VFP3/5 days when BindEvent() didn't exist. Simply edit your custom grid to use custom header. Then you would write your code into a single header class. For a sample you can download my MultiselectGrid class:
Download #9361
Cetin

>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform