Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Indexing Question
Message
 
 
À
23/02/2001 08:57:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00478788
Message ID:
00478797
Vues:
21
Hi!

I don't know exactly if following will work, its just an idea.

Make function specially for DynamicBackColor and call it there. Put there code like following:
if recno("MyAlias")<> thisform.OldRecNo
  thisform.OldRecNo = recno("MyAlias")
  thisform.MyValue = thisform.MyValue + 1
endif

IF MOD(thisform.MyValue, 2)=0
  return lnGrey
else
  return lnBackground
endif
Probably, the function will be called for each column and each row. When row changes, the value of special row counter increases and thus color changes. There might be also a problem with even/odd rows (the same row becomes gray or white when scrolling), so I assume it is not a good solution.

Another solution is to make a special field for cursor where you can re-calculate a real row number each time when indexing changes (I assume cursor is changable). Thna use that value in your DynamicBackColor expression.

HTH.


>Hi All,
>
>I am using a grid with a striped background, by doing the following.
>
>.SetAll("DynamicBackColor", "IIF(MOD(RECNO('tablename'), 2)=0, lcGrey + "," + lcBackground + ")", "Column")
>
>My grid's recordsource is set to an indexed table. The grid relies on record numbers to highlite rows, in an indexed table the record numbers are not sequential so the grid ends up having lots of grey stripes then none etc.
>
>Is there anything I can do about this (apart from doing a select... order by?)
>
>On top of this, I have column sorting on the header clicks for the grid - this again causes the same problems as above.
>
>Obviously other people will have encountered this problem - but I can't think of a generic solution for it... Any ideas?
>
>TIA
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform