General information
Category:
Forms & Form designer
>I am trying to get the active grid row (2 columns) to be highlighted and remain highlighted when the focus is moved on. I know DynamicBackColor may be used, but it doesn't seem to work. I've tried some previous suggestions, but they did not work - can anyone give simple instructions.
>
>Thanks in advance.
You can use the dynamic properties - the only problem is that if you don't use them right you get slow performance
to avoid that you can you can create a sub-class of a grid :
add 3 properties
lok,nbackcolor(and /or forecolor) and nRecno
Grid Valid Event :
this.lok=.f.
return .T.
Grid When Event :
this.lok=.t.
Grid BeforeRowColChange
LPARAMETERS nColIndex
if this.lok
this.nRecNo=-99999
endif
in the Grid's Init event you can do something like
this.nRecno=recno()
this.setall("DynamicBackColor",;
"IIF(recno()=this.nRecno, ;
this.nBackColor,this.Backcolor)","Column")
this.setall("BackColor",(this.nBackColor),"GrdTextBox") && no need to set sparse to .f.
GrdTextBox is a subclass of textbox that should be used inside each grid column
with the following code in the GotFocus event:
this.parent.parent.nRecno=Recno()
Arnon
Previous
Next
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