Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grids 101 - why am I so lost ?
Message
From
14/12/2006 09:37:24
Mike Yearwood
Toronto, Ontario, Canada
 
 
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:
01177582
Views:
34
>Thanks Tore! Your reply makes me feel much better. I'm glad that others find grids difficult, as "there's comfort in numbers" :)
>
>Some replies have suggested I use Views, SQL, or anything but tables - which I am sure I will at some point. I even had a nice chat with a VFE trainer - he seemed to prefer using a separate data entry window for invoice detail scenarios like mine. I suspect that his preference may be more based on the VFE framework's design philosophy, rather than what users prefer in their GUI. I know that I, like my users, find entering invoice line items in a grid much more natural (that's how we do it on paper invoices, right).

Nope. It's nothing to do with VFE per se. I do a similar thing with my approach, in MaxFrame.

>
>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 :)
>
>
>
>
>>Mike,
>>
>>just to inform you, or maybe warn you is a better word in this case. I have programmed xbase for around 20 years, and I take the liberty to call myself an advanced programmer. But I still don't have enough experience and knowledge to use a grid for data input like you want to. It's way more complicated than you think, so you have to add a lot of code to some of the objects in the grid.
>>
>>I spent a week last year trying to get it to work, but I simply had to give it up, it took too much time. But then again, I must admit that I had set my goals really high, I needed much more than just the usual order entry stuff.
>>
>>NB! I don't want to discourage you, I really hope you are more successful than I was. I will probably pick up my own project soon, hopefully I will get it done this time. :-)
>>
>>>Hi Terry,
>>>
>>>My form is a complete invoice. The form's grid allows the user to add/edit/view all the ***line items*** (InvDtail table) for the current invoice. My users prefer to enter invoice line items in a grid, as that most closely resembles paper invoices that we are all familiar with. There are actually a few more columns in my real grid - I just left them out of my example to simplify this post.
>>>
>>>I think you assumed I was using the grid to see the invoice headers ? Again, I am (trying) to use the grid as a data entry area for the invoice DETAILS...
>>>
>>>It still boggles my mind that a grid would not be able to easily display several fields from an Invoice(details) table as well as a corresponding part description from a Products table (linked by ItemCode). This was child's play in FWD/FPW with a browse. Granted, no combo box could be easily put in a browse... Let me clarify: a grid can * display* such things, but once I put a combo box in, allowing the user to select the Part# of the item being sold, some kind of voodoo magic happens behind the scenes that causes the combo's dropdown list to misbehave (closes after any key press). From my limited knowledge, the combo's dropdown list should not close until user makes a selection, hits ESC etc.
>>>
>>>
>>>>This strikes me as odd though: I see the grid as a way of displaying what invoices have been made, presumably from some earlier process that created the orders. So how come you're altering the part in an order at this point? If you want to change that how come you don't do it via the order editing/creation form?
>>>>
>>>>If you want some advice on programmatically creating and populating a grid, from an SQL cursor/view, indeed WITH a working selection combo in it, then I'd be happy to send you some code examples.
>>>>
>>>>HTH
>>>>
>>>>Terry
>>>>
>>>>>New to VFP, I've now got about 30 hours into trying to make a grid work with a combo box. Here is a simplified outline of what I am trying to do. Greatly appreciate any suggestions!
>>>>>
>>>>>I have an invoice detail table(I) and a products table(P). I defined my grid's RecordSourceType=Alias, RecordSource=I etc. I want my grid as follows:
>>>>>
>>>>>Part# Description Qty Price
>>>>>------ ------------- --- -----
>>>>>
>>>>>Part# - combo box: 0-Dropdown, RowSource=P.PartNo,PartDesc, ControlSource=I.PartNo
>>>>> dropdown list will display "Part# | Description"
>>>>>
>>>>>Description - text box - ControlSource=P.PartDesc (read-only, not saved in I)
>>>>>
>>>>>Qty - text box: ControlSource = I.Quantity
>>>>>
>>>>>Price - text box: ControlSource=I.Price
>>>>>
>>>>>
>>>>>My problem is that a grid configured this way behaves quite odd: when the combo's list (Part#) drops down, it clears the instant I press any key. I think VFP is seeking in the Products table, trying to update the Description column? But shouldn't the combo remain dropped down until user selects something, hits ESC etc ? If I change Description column's ControlSource to (none) and its text box's Value property to "Test Description", the Description column will display "Test Description", but ONLY when that column has the focus (blank otherwise). So I guess my question is how do I display a calculated value for a column - regardless of whether column has focus ? Again, setting Description column's ControlSource=P.PartDesc causes all kinds of screwy behavior with the Part # combo box.
>>>>>
>>>>>I have a hunch I could avoid all these problems if I used an array RowSource for the combo. But I really want to learn from this "episode". I hate giving up :)
>>>>>
>>>>>Many thanks!
>>>>>
>>>>>PS. How do you change UT forum messages to use fixed fonts, so columns line up?
Previous
Reply
Map
View

Click here to load this message in the networking platform