Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disappearing ComboBox value on selection ...
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Disappearing ComboBox value on selection ...
Miscellaneous
Thread ID:
00709646
Message ID:
00709646
Views:
130
in a grid when Sparse is set to .F.

This drove me nuts ... until I saw a post from Marcia Akins

This is a known issue. Change the RowSource to something other than 2-Alias or 6-Fields and this problem will go away.

KNOWN ISSUE ... TO WHOM? It wasn't in that Tech search thingy that M$ charges a couple of hundred bucks for that resides on my desk top at work. Luckily enough it was on the Universal Thread because Ms. Akins dropped by one afternoon. (A better plug for a PUTM membership I don't know how to give ?!?! ... the ability to search on "Combobox" and "Grid").

The symtoms were as follows:

Select the combo box in the grid column and the value disappears ... select another column in the grid and the display value for the combo box displays properly ... select the combo box again and the value disappears once more. Aaarrrgghhh! Getting focus loses the display value.

The combo box's properties were set as follows:
(CPersonRole consisted of three columns in this order "CDesc", "CCode", "iID"

.BorderStyle = 0
.BoundColumn = 3
.BoundTo = .T.
.ColumnCount = 3
.ColumnLines = .F.
.ColumnWidths = 120,20,0
.ReadOnly = .F.
.SpecialEffect = 1 (Plain)
.Style = 2 (Dropdown List)

.RowSource = "CPersonRole"
.RowSourceType = 2 (Alias)

The problem:
When the Grid's .Sparse property was set to .T. the combobox behaved as it should. The selected value displayed when the control had focus and when it did not. When the drop down list was exposed, the proper item was selected. The problem with this approach is that all of the rows where the ComboBox was not displayed (remember that .Sparse setting of .T. for test purposes?) the column displayed the value 68 (the Foreign Key for the person's role ... technically correct) ... but not good from a interface design perspective.

When the Grid's .Sparse property was set to .F. the comboboxes displayed the proper value UNTIL the column received focus. Then, the display value was blank ... nada ... nuthin ... zilch.

I reviewed the property settings 20 or more times just to make sure I wasn't doing something stupid (been known to happen before) ... and all the tricks were covered with the proper settings ... EXCEPT ONE ...

This arrangement simply doesn't work if the RowSourceType is Alias (2) or Fields (6). It does work with the RowSourceType set to Array (5). The solution was to copy the contents of the cursor to a member array of the form and bind the control source to that array. After that ... the solution behaved as I expected it should have all along. How retarded is THIS?

Unbelievable that we can have such an advanced language and still have to fight with S.o.f.a K.i.n.g W.e T.o.d.d D.i.d stuff like this on a Wednesday afternoon (insert your own relavent time span here).

So, in conclusion Calvin, how about making that ComboBox and the Grid work for me like a reasonable man would expect ... please add this to my Version 9.0 wish list?

Love, hugs and sloppy wet tongue kisses,

CTBlankenship
Next
Reply
Map
View

Click here to load this message in the networking platform