Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DynamicFontBold problem 1

Status
Not open for further replies.

SGLong

Programmer
Jun 6, 2000
405
0
0
US
I'm noticing a really strange problem with a piece of code for the DynamicFontBold event. Here's the problem.

I have a table with 4 text fields and a logical field. In the fifth column of my grid I've added a CheckBox control and set it to the Current Control. All Columns have the Sparse property set to .F.

In the form INIT if have the following:
Code:
thisform.grid1.SetAll("DynamicFontBold","IIF(thisform.grid1.column5.check1.value =.T.,.T.,.F.)","Column")

In the InteractiveChange event of the checkbox I have:
Code:
thisform.grid1.refresh()

Now here's the problem. If I check the checkbox on row 6, the font for row 1 and row 7 turn bold. Nothing happens to row 6. If I uncheck the checkbox, rows 1 and 7 return to the normal (unbolded) font.

Does anyone have any idea what's going on here and how I can solve it?

Steve



 
I can replicate the issue, but if I store the value to the recordsource and refer to that the issue goes away...

thisform.grid1.SetAll("DynamicFontBold", "IIF(MyTable.CheckBox =1,.T.,.F.)", "Column")
 
Thanks baltman... that got me one step further. Now another problem has surfaced that I hope you or someone else can help me with.

All of the logical fields in my table are set to false when the screen opens. If I click/check the checkbox nothing happens. When I click/uncheck the checkbox again the row turns bold. When I again click/check the checkbox the bold goes away. It seemed like the logic was reversed, so I changed my SetAll command and reversed the .T. and .F. settings. Then when the form opens up everything is bold, and clicking the checkbox again has the reverse effect.

Any suggestions?

Steve


 
Contmaster has a logical field called tradein. This only makes the Checkbox caption Bold Not the whole row. The table has 5001 records. The Scan takes nano seconds
Setall is causing the problem (IMO)
Code:
*Checkbox.Valid()
Select contmaster
ogrid = Thisform.grid1
nrec = 0
If Nvl(Oldval("tradein","contmaster"),"") = This.Value
    Return &&& dont run scan if nothing has changed
Endif
Scan
 If contmaster.tradein
   ogrid.Columns(5).DynamicFontBold = "IIF(tradein, .T., .F.)"
   nrec = Recno()
   ogrid.Refresh
 Endif
Endscan
If nrec > 0
 Goto nrec
Endif
 
Thanks Imaginecorp... that looks like it should solve my problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top