Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date column in the grid with SET CENTURY ON
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
00993628
Message ID:
00994835
Vues:
15
>>>Hi Nadya,
>>>
>>>This should work:
>>>
>>>myform.mygrid.column1.Sparse=.f.
>>>myform.mygrid.column1.text1.Century = 0
>>>
>>
>>Dawa,
>>
>>I was happy with the solution, but my manager noticed, that these two columns are not shown in blue color, e.g. highlight doesn't work. I seem to recall some problem with native VFP highlight implementation and sparse = .f. Am I out of luck or there is a simple solution?
>>
>>Thanks in advance.
>Try this:
>
>** Add a property pnRecord to your form and initilize it with 0
>myform.mygrid.column1.Sparse=.f.
>myform.mygrid.column1.text1.Century = 0
>myform.mygrid.column1.text1.BackStyle = 0
>myform.mygrid.column1.DynamicBackColor="=iif(recno(this.RecordSource)=thisform.pnRecord,this.HighlightBackColor,this.BackColor)"
>
>** AfterRowColChange event
>thisform.pnRecord=recno(this.RecordSource)
>IF m.nColIndex = 1 ; && 1 is the column1
>THEN
>  this.column1.text1.BackStyle = 1
>ELSE
>  this.column1.text1.BackStyle = 0
>ENDIF
>this.refresh()
>
Dawa,

Thanks again. I used the variation of your code. I added a new property to the grid lManualHighlight and if I set this property to true (in cases I need to use sparse = .f. for any of the column) I use Dynamic properties.

I also added some code to our cGridTextbox (unfortunately, I had to modify the MereMortals class for this). I added nBackColor and nForeColor properties to this textbox and I have:
this.nBackColor = this.BackColor 
this.nForeColor = this.ForeColor

this.BackColor = this.Parent.Parent.HighlightBackColor
this.ForeColor = this.Parent.Parent.HighlightForeColor
and restore them back in LostFocus. Seems to work nicely.

Thanks again.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform