Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DynamicBackColor of Each Column are different!
Message
De
21/08/1999 11:58:27
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
20/08/1999 21:42:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00255740
Message ID:
00256259
Vues:
48
>>Justok,
>>First the expression is wrong. You must put the whole expression as a char string :
.DynamicBackColor = "IIF(Empty(myTable.Field1),rgb(0,0,0),rgb(192,192,255))"
Next, to make the life easier for you, you could delegate the coloring to a function :
*Grid.init
>>for each oColumn in ThisForm.Grid1.columns
>> oColumn.DynamicBackColor = "GimmeColor(["+oColumn.Controlsource+"])"
>>endfor
Your function would then return a color based on controlsource.
>>Cetin
>

>
>Thanks both of you!
>
>What happen if I pass "This.name" inside setall() function?
>
>Thisform.grd1.SetAll("Caption", "This.Name", "Header")
>
>grd1.name or header1.name ?!
>
>if use header1.name, I can do:
>
>Thisform.grd1.SetAll("DynamicBackColor", "Thisform.GimmeColor(This.ColumOrder)", "Column")
>
>^_~
Unfortunately you cannot. If you setall("Caption", "This.Name", "Header") then all your captions would literally be "This.Name". If you don't put the quotes then depends on where you call it from and only evaluated once at the time of call.
For dynamic* properties this refers the grid. ColumnOrder is a property of column not grid. That means you wouldn't be able to use this.ColumnOrder.
This sample cross highlights a cell (column + row is highligted) :
this.SetAll("DynamicBackColor", ;
  "iif(recno(this.recordsource) = thisform.nCurRec or " +;
  "this.activecolumn > 0 and this.columns(this.activecolumn).controlsource "+;
  "= lower(this.recordsource+'.'+varread()), 256^2-1,256^3-1)","Column")
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
Répondre
Fil
Voir

Click here to load this message in the networking platform