Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GRID ::: Manipulated values in Text Box in Grid
Message
De
04/09/1998 06:20:56
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
04/09/1998 06:02:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00133151
Message ID:
00133168
Vues:
13
>>>I have a grid, which is based on table. The col2 , is readonly col. and that col2 is actually string manipulation of fields 2,3 and 4 of a table.
>>>
>>>How would I do this ?
>>Satya,
>>You mean you want to show something like ie :
>>substr(columns(2).value,1,3)+substr(columns(3).value,4,7) ?
>>If so, you set controlsource to be manipulated field expression. That column is a "calculated value" and readonly by default (you cannotmake it RW).
>>Cetin
>
>
>Exactly the same way.
>the col2 , control source is like that, but, I have a very long method of writing that code.
>
>eg :
>
>if col(2)).value = 'A' then
> column2.controlsource = 'Attribute' + str(col 3) + ..blah blah
>else
> blah
> blah
>endif
>
>Where should I write this code (I mean in what method or event)
>for that column ?
Satya,
Instead of columns(2).value use its controlsource ie: customer.contact. Then you could build an inline if (iif()) or use an external udf().
* Grid.init
this.columns(5).controlsource = ;
    [iif(customer.contact ="A",]+;
    [substr(customer.contact,2,2),]+;
    [substr(customer.company,2,2))]
* Or directly in PEM sheet
iif(customer.contact ="A",substr(customer.contact,2,2),substr(customer.company,2,2))
cetin
Ç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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform