General information
Category:
Forms & Form designer
Hello Dear,
You can make current row highlight in grid with following examples
Example 1
Put following codes in afterrowcolchange of grid
ThisForm.grid1.SetAll("DynamicBackColor", ;
"iif(ThisForm.grid1.activerow = This.activerow, RGB(0,255,0);
,RGB(255,255,255))", "Column")
Example 2
Create a custom form property say CurrentRec and initialize it to zero. At your form's INIT, add this line,
ThisForm.Grid1.SetAll("DynamicBackColor","IIf(ThisForm.CurrentRec = RecNo(),RGB(0,255,255),RGB(255,255,255))","Column")
Note: You can change RGB(0,255,255) to any color you want. Then in the grid's AfterRowColChange Event, add the lines:
This.Refresh
ThisForm.CurrentRec = IIf(ThisForm.CurrentRec # RecNo(),RecNo(),ThisForm.CurrentRec)
Example 3
Put the following codes at the init of form
IF DODEFAULT()
THIS.ADDPROPERTY("nCurrRec",RECNO())
THIS.SETALL("DynamicBackColor", "IIF( Recno();
=this.nCurrRec,RGB(14,225,247),RGB(255,255,255))", "COLUMN")
ENDIF
Put following codes in afterrowcolchange of grid
if dodefault( nColIndex)
this.nCurrRec = RECNO()
this.Refresh()
ENDIF
If you find any problem, do contact me
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only