**********************************************************
** How to make grid display current row in distinct color?
**********************************************************
** by Subramanian.G (ramani)
** FoxAcc Software
** ramani_g@yahoo.com
**********************************************************
At the form level create a variable,say,[color /blue] inRecNo [color /] and put the initial value as [color /blue] 0 [color /]. Add code as suggested below ..
[color /blue]
MyGrid.InitEvent
****************
DODEFAULT()
WITH THIS
.SetAll("DynamicBackColor", ;
"IIF(recno(This.RecordSource)=ThisForm.inRecno, ;
RGB(0,255,255),RGB(255,255,192))","COLUMN")
ENDWITH
[color /blue]
MyGrid.AfterRowColChangeEvent
*****************************
DODEFAULT()
ThisForm.inRecNo = RECNO()
This.Columns(This.ActiveColumn).Text1.BackColor = RGB(0,255,255)
This.Refresh()
[color /]
**********************************************************
This will make the back color of the row your are editing in the grid.. to SkyBlue. while the rest of the records will have a distinct cream/yellow.
**********************************************************
OR alternative method [color /blue]
**********************************************************
MyGrid.InitEvent
****************
DODEFAULT()
WITH THIS
.SetAll("DynamicBackColor", ;
"IIF(recno(This.RecordSource)=ThisForm.inRecno, ;
RGB(0,255,255),RGB(255,255,192))","COLUMN")
ENDWITH
nColumncount=This.ColumnCount
For I=1 To nColumncount
Objref=Eval('this.columns(i).'+ ;
This.column1.CurrentControl)
Objref.BackColor=RGB(0,255,255)
Objref.SelectedBackColor=RGB(0,255,255)
Objref.SelectedForecolor = RGB(0,0,0)
Endfor
********************************************************* [color /]*********************************************************
** EOF **
** Ramani (Subramanian.G), FoxAcc, ramani_g@yahoo.com
**********************************************************
Evaluate this to make others know how useful is this
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.