Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grids 101 - why am I so lost ?
Message
From
14/12/2006 22:14:07
 
 
To
14/12/2006 20:45:55
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:
01177866
Views:
25
I think a glass (or two) of red wine is in order :)


>Be careful Mike. The grid is quite a beast to tame ;-)
>
>>First, I want to THANK everybody for all the help provided!
>>
>>I DID get my invoice form, with a grid for the invoice details, to work!@#@#!
>>
>>The problem, where the dropdown combo list would close as soon as I pressed any key, was because several of the grid columns had a ControlSource set to a field in the PRODUCTS table. The first column (dropdown combo), also had its ControlSource set to PRODUCTS (the ItemCode field). For some unknown,undocumented reason, VFP exits out of the dropdown combo control to update the other PRODUCT-related columns *everytime* any key is pressed while in the combo's dropdown list. So the dropdown loses focus, which of course kills any incremental search...
>>
>>The solution: I changed the ControlSource for the several PRODUCTS columns to memory variables. I update these mem vars in the combo control's Valid() and do a refresh of those columns. Works like a champ, incremental works as expected etc.
>>
>>For any other newbies, I found the "event tracking" feature of the VFP debugger to be powerful technique to troubleshoot complex problems like this. You can enable event tracking in the Debugger's Tool menu.
>>
>>Again, thanks to all of you!
>>
>>-Mike
>>
>>"Never say never"
>>
>>>>>>>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!
>>>>>>>
Previous
Reply
Map
View

Click here to load this message in the networking platform