Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Action code in a Method for dynamically defined Grid
Message
 
À
16/02/2005 14:07:45
Freddie Rodrigues
Bitrun Business Solutions
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00987097
Message ID:
00987590
Vues:
63
This message has been marked as a message which has helped to the initial question of the thread.
O! Now I understand. Let's make some changes :o)))
DEFINE CLASS MytextBox AS textBox
     ValidRoutine = ""

     PROCEDURE Valid
         LOCAL cValid
**** Change
         FireValid = IIF(TYPE("FireValid") # "L", .t., FireValid) 
         IF FireValid .AND. .NOT. EMPTY(this.ValidRoutine)
**** End Change
            cValid = this.ValidRoutine
            RETURN &cValid
         ENDIF
     ENDPROC
ENDDEFINE

**** Now Your Grid build

Thisform.pageframe1.page1.coloursgrid1.RecordSource = "&mDSGrid"
Thisform.pageframe1.page1.coloursgrid1.ColumnCount = mnColumnCount
Thisform.pageframe1.page1.coloursgrid1.Removeobject("Column1")

Local mNowCount,mColumnWidth,mColumnValid,mColumnCaption,mColumnAlignment

**** Change  IMPORTANT DO NOT declare this variable as LOCAL
FireValid = .f.
**** End Change
FOR mNowCount = 2 to mnColumnCount
    mColumnName = "Thisform.pageframe1.page1.coloursgrid1.Column" + ALLTRIM(STR(mNowCount))
    WITH &mColumnName
         .AddObject("MyText1","MytextBox")
         .RemoveObject("Text1")
         .CurrentControl       = "MyText1"
         .MyText1.Visible      = .t.
         .Alignment            = 2
         .Width                = mDimColumnWidth(mNowCount)
         .MyText1.ValidRoutine = mDimColumnValid(mNowCount)
         .Header1.Caption      = mDimColumnCaption(mNowCount)
    ENDWITH
NEXT
**** Change
FireValid = .t. && This line You can skip, because After Leaving BeforeRowColChange VFP releases it.
**** End Change
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform