Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More grids...
Message
From
20/12/2001 06:14:21
 
 
To
20/12/2001 05:24:38
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00596624
Message ID:
00596646
Views:
17
Hi!

See notes below...

>It's grid day today!!!
>
>I've just noticed that you can't manually input rows into a grid i.e there's no additem, addlistitem etc.
>

Take a look to the grid's property "AllowAddNew".

>The reason? We lets say I want to take an ADO recordset and show in that there grid. As far as I can see I have to put it into a VFP table first.
>
>If there's another way of doing that I'd be very interested. And yes I am a lazy spud!!!
>

Yes. Create a temporary cursor with only integer field and as many records as you have in the ADO recordset. Bind grid to that ADO recordset and specify column control sources to look like "thisform.LookupField('FieldName')". Define a method LookupField on the form that will position record pointer in the ADO recorset accrdingly to the value in the integer field in the grid's cursor (if record changed), and then return a field value from the ADO recordset. When grid refreshed, this method will be called for each cell.

Anyway, it might refresh grid slower than with native VFP cursor, so conevrting ADO recorsed to VFP cursor is recommended (You can do this quickly by using VFPCOM.DLL from MS that is an add-on for VFP6). Also, such grids are read-only.

HTH.

>Cheers, Pablo
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform