Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Selectively Disable Cells in a grid
Message
 
 
À
06/06/2000 08:59:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00376845
Message ID:
00381805
Vues:
16
>I do not think I made my self clear. What I am trying to do is set the properties of cells when the grid (form)
>is invoked not as data is entered. That is if certain cells already have data in them then they and related cells
>cannot be changed. For example if cell 4 in row 5 has a value (which implies cell 3 also has data in it) then data
>in those cells cannot be changed. In that case I would like to make cells 3 and 4 read/only (enabled = F) and
>change the backcolor to grey (it is white when data can be entered). I assumed this would have to be done in
>the init method of the grid since a the when method is only tirigger if user goes to that cell. This is what I am
>having problem doing. A concrete example of how to do this would help. Thanks.

Hi Claude,

This is a sample code in Grid.Refresh. It should be called from AfterRowColChange also.

if thisform.editmode
.columnAPN.DynamicBackColor="IIF(APNED='"+APN_DUPL+"' OR APNED='"+APN_BAD+"'," + CB_EDON + "," +CB_NONED+")" && Green
.columnMapNum.DynamicBackColor= "IIF(Parsed='"+ PARSE_DUPL+"' OR PARSED='"+PARSE_BAD+"'," + PCB_EDON + "," +CB_NONED+")" && Red
.columnWardNum.DynamicBackColor= "IIF(Parsed='"+ PARSE_DUPL+"' OR PARSED='"+PARSE_BAD+"'," + PCB_EDON + "," +CB_NONED+")" && Red
.columnLotNum.DynamicBackColor= "IIF(Parsed='"+ PARSE_DUPL+"' OR PARSED='"+PARSE_BAD+"'," + PCB_EDON + "," +CB_NONED+")" && Red
.columnBlockNum.DynamicBackColor="IIF(Parsed='"+ PARSE_DUPL+"' OR PARSED='"+PARSE_BAD+"'," + PCB_EDON + "," +CB_NONED+")" && Red
.columnUnitNum.DynamicBackColor= "IIF(Parsed='"+ PARSE_DUPL+"' OR PARSED='"+PARSE_BAD+"'," + PCB_EDON + "," +CB_NONED+")" && Red
.columnAPN.ReadOnly=iif(APNED=APN_DUPL OR APNED=APN_BAD,.f.,.t.)
else
.columnAPN.DynamicBackColor="IIF(APNED='"+APN_DUPL+"' OR APNED='"+APN_BAD+"'," + CB_EDOFF + "," +CB_NONED+")" && Gray
.columnMapNum.DynamicBackColor= "IIF(Parsed='"+ PARSE_DUPL+"' OR PARSED='"+PARSE_BAD+"'," + CB_EDOFF + "," +CB_NONED+")" && Gray
.columnWardNum.DynamicBackColor= "IIF(Parsed='"+ PARSE_DUPL+"' OR PARSED='"+PARSE_BAD+"'," + CB_EDOFF + "," +CB_NONED+")" && Gray
.columnLotNum.DynamicBackColor= "IIF(Parsed='"+ PARSE_DUPL+"' OR PARSED='"+PARSE_BAD+"'," + CB_EDOFF + "," +CB_NONED+")" && Gray
.columnBlockNum.DynamicBackColor="IIF(Parsed='"+ PARSE_DUPL+"' OR PARSED='"+PARSE_BAD+"'," + CB_EDOFF + "," +CB_NONED+")" && Gray
.columnUnitNum.DynamicBackColor= "IIF(Parsed='"+ PARSE_DUPL+"' OR PARSED='"+PARSE_BAD+"'," + CB_EDOFF + "," +CB_NONED+")" && Gray
.columnAPN.ReadOnly=.t.
endif
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform