Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
My grid shows the same record in all rows
Message
From
12/04/2000 10:32:01
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00358600
Message ID:
00358665
Views:
10
>Hi All:
> Need help on populating the grid with the cursor. Problem is that when the controlsource of the columns for the grid is tied to a table every thing is fine, however, when I try to populate the grid with the cursor all hell breaks lose. The issue is that when I click on the grid, all the columns on the grid gets populated with the very first record from the cursor. Thus, every record on the grid is the same as the every first record for the cursor.
>
>Thanks


Sounds like recordsource is not the cursor itself. I frequently use grids with cursors, create grids on the fly. For a simple example this would work if you have an index on upper(last_name) in table :
* Init or someother method of grid
with this
 .Recordsource = ""
 .Columncount = -1
 .Recordsourcetype = 4
 .Recordsource = "select * from employee ;
           where upper(last_name)=upper(trim(thisform.text1.value)) ;
           into cursor crsGrid"
endwith
Then you could just code this in thisform.text1.lostfocus :

thisform.myGrid.Refresh

For a more detailed sample download gridx.zip from files\classes section and check init method of multiselectgrid class. It entriely works with cursors.
Cetin
Ç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