Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to highlight current row in inactive grid?
Message
From
06/01/1998 14:46:16
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00069392
Message ID:
00069859
Views:
72
>>>Form has parent and child grid controls, e.q. document and document rows.
>>>When child grid is active, it is desirable that current row in parent
>>>grid is distinguishable from others.
>
>Did you know that there is a default property of grids that will show or hide a column that contains a current row pointer, which is always visible whether the grid currently has focus or not. This would be the simplest way, since it's already built in! No coding required! :)
>
>Dana
Hi Dana,
I'm afraid you're not so right. Try to move the rec pointer outside of the grid. If it was the case there wouldn't be many asking for highlighting the current row in a grid.
There are a lot ways to do it and here is one :
Form has a custom property nCurrec.
* Grid.afterrowcolchange
if recno(this.recordsource) # Thisform.ncurrec
	thisform.nCurrec = recno()
	Thisform.setall("dynamicbackcolor", ;
		"iif(recno(["+this.recordsource+"]) = "+transform(thisform.nCurRec,"99999")+;
		",RGB(128,128,128),rgb(255,255,255)","column")
  	this.refresh()
endif	
* For this work outside of the grid you could add a property for caller reference, after moving rec pointer set it to "this" and call ...grid.setfocus()(ie: thisform.oCaller) and change the afterrowcolchange a little bit :
if recno(this.recordsource) # Thisform.ncurrec
	thisform.nCurrec = recno()
	Thisform.setall("dynamicbackcolor", ;
		"iif(recno(["+this.recordsource+"]) = "+transform(thisform.nCurRec,"99999")+;
		",RGB(128,128,128),rgb(255,255,255)","column")
  	this.refresh()
endif	
if type("thisform.oCaller") = "O"
   thisform.oCaller.setfocus()
   thisform.oCaller = " "
endif
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform