Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Highlighting a Grid Row
Message
From
18/05/1998 00:59:30
 
 
To
17/05/1998 05:52:33
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00099972
Message ID:
00100037
Views:
93
>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
Map
View

Click here to load this message in the networking platform