Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Referencing a grid column after moving its order
Message
De
20/06/2007 13:01:01
 
 
À
20/06/2007 12:20:57
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01234519
Message ID:
01234529
Vues:
16
This message has been marked as the solution to the initial question of the thread.
>I have a standard grid on a form. When the form is run, the grid appears with the column showing data as expected. If I then drag a column out of its initial location, how do I get an object reference to that column? In particular, I want to get to its controlsource.
>
>I've tried using the grid's activecolumn property but that doesn't work for me. For example, if I drag column5 to be in position 2 (measured relative to the left edge of the grid), ActiveColumn returns 2. What property (if any) could I use to return 5 or something that would indicate that column2 started out as column5?
>
>TIA


Mike,

You have to loop through the columns and find which one has ColumnOrder == ActiveColumn

Something like
local n
n = -1  && none
with m.this
   for i = 1 to .ColumnCount
      if( .Columns[m.i].ColumnOrder == .ActiveColumn )
        n = m.i
        exit
      endif
   endfor

endwith
return m.n
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform