Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Loses Props After RecordSource Is Recreated
Message
From
12/10/1998 19:20:08
 
 
To
12/10/1998 15:49:37
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00146001
Message ID:
00146053
Views:
26
>Hi,
>
>I'm having a heck of a time with a grid that I'm using in one of my forms, here's the problem:
>
>My grid's recordsource is set to a cursor. Every time the user clicks on a different date, that cursor is re-created on the fly with the updated information. Once the cursor is re-created, however, my grid loses all it's properties (formatting) and looks pretty sad. That's why in my method which performs the SQL statement which re-creates the cursor, I re-format my grid.
>
>The point is, I don't want to have the grid's properties get reset on the fly because that presents problems with my textbox class which is in the grid columns (and calls right click menu, etc.).
>
>Does anyone know of a way I can keep the grid from losing it's formating properties whenever I recreate the cursor that's used as it's recordsource?
>
>Much appreciated for any help!
>
>-JT
>
>P.S. I want to avoid using a view here if possible due to the complex nature of my SQL statement (view designer does not like more than one join and UDF calls).


Forget using views. I had the same problem. The solution is simplicity itself.
Here's how.

When you want to do a new select to display:
Thisform.grdMyGrid.RecordSource = "" or SPACE(0)
Select ..... into cursor/table/ myselect
ThisForm.grdMyGrid.RecordSource = myselect

The select MUST give the same output - fields as the previous one . Voila! your grid is filled with new data with all the formatting in the grid retained. This tip is not mine. Just passing it on.
Previous
Reply
Map
View

Click here to load this message in the networking platform