Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best way to re-create all columns in grid
Message
De
20/09/2001 14:13:29
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00556193
Message ID:
00558876
Vues:
47
Mike Stewart havewn't replied to my last message in UT so I think they are not
interested about this. I must find solution myself or re-write my program in o Delphi.

>Mike Stewart and John Koziol would be the ones really interested in this. However, they would only need what is necessary to reproduce the error.
>
>>I you are seriously interested about fixing this, I can send you the source code. I may try to simplify it much as possible without losing C5 functionality
>>but it will be still a hunders of lines for code and many classes. Future simplification will lose the functionality I need.
>>
>>
>>>First I created a copy of my Foxuser table and called it FXUser.dbf/fpt. I put a grid on a form and named it Grid1. In the Click of a command button I placed the following code:
>>>LOCAL lcSource, lnCount, lnI, lnJ, lnK
>>>FOR lnJ = 1 TO 1000
>>>   WITH ThisForm.Grid1
>>>      lcSource = .RecordSource
>>>      .RecordSource = ""
>>>      lnCount = .ColumnCount
>>>      FOR lnI = lnCount TO 1 STEP -1
>>>         .RemoveObject(.Columns(lnI).Name)
>>>      ENDFOR
>>>      FOR lnI = 1 TO 3
>>>         .AddObject('Column' + TRANSFORM(lnI), 'Column')
>>>         IF lnI = 2
>>>            .Columns(lnI).AddObject("Combo1", "Combobox")
>>>            .Columns(lnI).RemoveObject("Text1")
>>>            .Columns(lnI).CurrentControl = "Combo1"
>>>         ENDIF
>>>         .Columns(lnI).Visible = .t.
>>>      ENDFOR
>>>      lnK = 1
>>>      .RecordSource = (lcSource)
>>>      FOR lnI = 1 TO 3
>>>         DO WHILE lnK <= FCOUNT(lcSource) AND NOT INLIST(TYPE(FIELD(lnK)), "C", "D")
>>>            IF lnK > FCOUNT(lcSource)
>>>               EXIT
>>>            ENDIF
>>>            lnK = lnK + 1
>>>            LOOP
>>>         ENDDO
>>>         .Columns(lnI).ControlSource = lcSource + "." + FIELD(lnK)
>>>         lnK = lnK + 1
>>>      ENDFOR
>>>   ENDWITH
>>>ENDFOR
>>>I have clicked the button several times and got no C5 error. Please try exactly what I did and see if you get the error.
Andrus
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform