Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Make the whole row of the grid to use the same forecolor
Message
From
04/07/2001 13:23:29
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00525731
Message ID:
00526723
Views:
17
Todd,
Thanks for the pointer and code :) However I have my own reasons designing them different.
I appreciate your code but just wanted to point a few places :
-I would prefer a grid level property in case I might have n grids (no problem having formwise).
-ARCC code is open to fail if columns are renamed or reordered. nColIndex return columnorder not actual columnindex. And you could never be sure if there is a text1 control there or if there is it might not be the current control.
-Moving setall code to refresh would only be usefull if columns are reconstructed. Still I'd prefer to call it once.
Cetin

>Cetin,
>
>As another alternative, this is a class you can download which seems to accomplish your goal and more...
>
>http://www.levelextreme.com/wconnect/wc.dll?UniversalThread~?2,54,Forum=5,28,1324
>
>
>or code it out as I did :
>
>
>1) CREATE A FORM PROPERTY CALLED RECNO (OR SOMETHING) AND SET VALUE TO 0
>
>
>2) IN THE INIT EVENT OF THE GRID:
>
>this.column1.text1.selectedbackcolor = rgb(255,255,128)
>
>
>3) IN THE AFTERROWCOLCHANGE EVENT OF THE GRID:
>
>LPARAMETERS nColIndex
>
>this.refresh()
>
>* set selected cell colors
>mycolumn="column"+alltrim(str(nColIndex))
>WITH this.&mycolumn..text1
> .selectedbackcolor = rgb(255,255,128) &&0,255,64)
> .backcolor = this.&mycolumn..text1.selectedbackcolor
> .selectedforecolor = rgb(0,0,0)
> .forecolor = this.&mycolumn..text1.selectedforecolor
>ENDWITH
>
>
>
>4)IN THE RFRESH METHOD OF THE GRID:
>
>Thisform.recno = recno("TABLENAME")
>This.setall("Dynamicbackcolor","iif(recno('TABLENAME')=thisform.vbrecno,rgb(255,255,128),rgb(255,255,255))","Column")
>
>
>
>
>Regards,
>
>Todd
Ç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
Reply
Map
View

Click here to load this message in the networking platform