Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ComboBox and Grid problems
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00195541
Message ID:
00195656
Views:
16
So you are saying what I am trying to do (related tables, combobox with an add option within a grid) is likely to fail?
Ok if that is so and you are pointing toward the shortcut menu as a solution can you tell me how I might allow a user to add a new item that does not appear in the shortcut menu?
Thanks
John

>There are few basic things here (they are not mandatory, but can help; it does not mean that other way will not work but it can give troubles).
>1) It's a good idea to use short-cut menu instead of combo.
>2) If #1 is not accepatable (e.g. because of client's wishes) then combo should be populated manually (Add(List)Item) and be bound on character field (I know abound BoundTo property but it still better to have character)
>3) The combo should be bound on cursor dummy field (here you can provide character). The real data replacement should be done in Combo.InteractiveChange or LostFocus events.
>4) Obviously, when we speak about grids, combos etc, there are absolutely should not be any temp relationships between tables.
>
>I hope that all this can help you. I really have some combos in grids, but mostly in older projects (i prefer to use shortcut menus now).
>
>>Hi John,
>>
>>I have been troubled by this problem for weeks now, the only difference in what I've been trying to do and what you're trying to do, is that you're using an array for the rowsource and I use a cursor. But it's interesting to me that you're having the same problems (I thought a lot of my problems were related to the rowsource cursor ... guess not). I've come up with a class for combos in a grid, but I'm still getting the bugs out. One thing it does not currently do that I'd like to incorporate is to be able to add new items to the rowsource. When I get it finished, I'll be happy to send it your way if you're interested, ... I'll have to look at it and see if it'll work with an array rowsource as well as a table.
>>
>>However, I would really love it if someone can point us to a source that shows how to do it properly (cuz I'm sure I've really bastardized it, not fully understanding what I'm doing, just plugging away) .... you're right, it doesn't seem like it should be all that exotic and yet, no one has been able to offer me much help in getting it to work the way I want it to, other than all the posts from everyone that help me understand how the darn things are supposed to work (both combos and grids).
>>
>>Anyway, I guess we'll get it all figured out one of these days! Be patient! (easier said than done :-))
>>
>>Bonnie
>>
>>>I have three tables in a DBC. A parent table(presentation), A link table(presobjlink), And a child table(objectives).
>>>
>>>I have a grid containing a field from the link table and a field from the child table. When a the user selects a different parent the grid properly displays the link field(s) and the children. It seems correct.
>>>
>>>So what I want to do is have a ComboBox that contains all the values for the field from the child table and of course allows the user to create a new value or select a previously entered value.
>>>
>>>I have a select statement that builds an array of the values in the child(objectives) table. I also expand the array to accommodate the "new value" a user might enter. I test the ComboBox outside the grid and it seems correct. So copy it into the grid, having removed the default text1 for the column. Now the ComboBox in the grid is erratic (OK so it is my understanding that is erratic). Sometimes it won't drop down the array. Other times it carries the value to the next field. Other times it announces that the control is read-only (this one seems like an eof()issue I have not solved).
>>>
>>>Can someone direct me to a source that shows how it is done properly. It does not seem that exotic.
>>>
>>>Thanks
>>>John
Previous
Reply
Map
View

Click here to load this message in the networking platform