Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid question
Message
De
11/05/2007 14:46:37
 
 
À
11/05/2007 11:08:22
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01224380
Message ID:
01224772
Vues:
17
Thanks for the response. I'll try to digest this over the weekend and see how to incorporate it into my grid.

......Rich

>>We have a customized grid class. In this class, a single click on a column header sorts the record source on that column. You can also click on a column heading and drag the column to another position on the grid. This action causes the sort to be performed. My questions
>>
>>1. Is it standard practice to have the single click perform the sort or is it more common to use a double-click?
>>
>>2. Assuming that I leave the sorting code in the Click method, is there any way to capture the fact that the column order has changed and then bypass the sorting code?
>>
>>3. Moving a column does not appear to change it's location in the grid.columns() array. For example. I pick up column 7 and move it to be column 5. The active column is now column 5 but a reference to grid.column(activecolumn).controlsource point the original column 5. Is there a simple way to re-order the reference in the grid.columns() array?
>
>Since nobody answered the (3), the trick is in the column events which have a nIndex parameter. This parameter is NOT an index into the .columns[] collection, it's the column order. You may need some code which will retrieve column index from column order. You can loop through .columns until you find one where .columns[i].columnorder=nIndex, or have an array of column indexes by columnorder... like this (assuming you don't have 6 columns and a columnorder of 200 on 4th column):
>
>
this.addproperty("aCols[1]")
>dimension this.aCols[this.columncount]
>for i=1 to this.columncount
>   this.acols[this.columns[i].columnorder]=i
>endfor
>
>You'd have to re-run this whenever a column is moved. Then in any method which needs it...
>
lparameters nIndex
>nColIndex=this.aCols[nIndex]
>with this.columns[nColIndex]
>...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform