Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid row selected
Message
 
 
To
13/08/2002 14:04:33
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00687200
Message ID:
00689288
Views:
29
Hi David,

ActiveRow property of the grid is not reliable, e.g. you can not base your highlighting on it. Use recno(this.recordsource) instead...

Yes, the idea of data-driven grid is pretty neat. My colleague and I use this technique in several applications. I also added ability to show ToolTiptexts and StatusBar text for grid's headers using technique described by Vlad Grynchyshyn (e.g. I have a special grid class) and I use my own Header class, which allows sorting by clicking on the Header...

>I was playing around with a grid and ended up adding the following to it:
>
>thisform.grid1.setall('dynamicbackcolor', 'iif(thisform.grid1.activerow = thisform.grid1.activerow, rgb[0,64,128], rgb[255,255,255])', 'column')
>
>thisform.grid1.setall('dynamicforecolor', 'iif(thisform.grid1.activerow = thisform.grid1.activerow, rgb[255,255,255], rgb[0,0,0])', 'column')
>
>This did the highlighting the way I wanted pretty well, although sometimes the grid would momentary display all rows highlighted - something I'm sure could be fixed (if your picky like me).
>
>Thanks for your code! I build most of my grids at runtime using a table. The table stores the property names and values for the grid. At runtime the table is scanned and using macro substitution the properties are defined for the grid. This way, at runtime, the user can go into a setup screen and change the properties for their grid to suite their needs and it instantly changes the appearance of grid. And being the data is in a table their settings will stay that way until they decide to change it again.
> Also, in runtime, if the record source for a grid needs to be requeryed or the record source name is changed the grid will do crazy things such as redefine column widths and header captions. But running the grid from this table can instantly put the grid back to the way it was.
> If I need to add code to objects that are within the grid I class them ahead of time and then use the AddObject method in the table.
> This works really good,... if you want I can send it to you.
>
>Thanks again for your help!
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform