Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grids 101 - why am I so lost ?
Message
From
14/12/2006 11:10:28
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
14/12/2006 09:02:15
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01177450
Message ID:
01177619
Views:
42
>But part of me says "hey, you are so close - do not give up!". If I could just figure out what VFP's grids are doing "under the hood" I know I could lick this...
>
>It's funny too: over the 20+ years I have been programming in Fox, when I look for rapid application development tools, I always ask the vendor "can your tool design a typical invoice form with a scrolling grid for entering line item details?" The answer always seems to boil down to NO, or "not exactly". I am hoping one of the frameworks has finally accomplished this :)

The inhouse framework on my last job did that perfectly - but it didn't use combos at all. The trick was in the validation. In the item nr column's validation routine (which was NOT in the .column.valid nor .column.text.valid - it was in the bizobject, which was in a .prg somewhere), I'd do a few SQL selects against the items table - trying to match the .value passed against the item codes (by = first, then by $), then against the item names. Generally, if it returns one record, use that; if it returns none, try next. If it returns multiple, pop up a little form with just a grid, where the user selects a record or not. If not, validation returns .f., and that's it.

The reasoning behind this is that combos are a bit unwieldy for the end user. They may be fine for a slow selection among a few dozen items, but for a fast selection from thousands of items, they amount to no good. Also, in the long run, combo's incremental search isn't good enough - there are entries that you can't find alphabetically (because some moron typed the name with quotation marks, or prefixed it with a (few) space(s), dash or just mistyped it) etc etc.

I've had combos in grids once, probably back in VFP5 and VFP6, and they worked, but weren't easy to handle. There was always one more thing to do to make them work. And, BTW, check the .sparse property for the combo's column. In one case, it means "use the specified nonstandard control for current row only", and in the other "for all rows". I still don't know exactly which is fot .t. and which for .f. - I just flip it when I don't like it :).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform