Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo with BoundTo = .T. in Grid
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00150601
Message ID:
00150657
Views:
24
>>>I have similar grid working OK, right before my eyes, so ... however, I see one more indication in your replies. Character-integer combo should work Ok, but it might be that your grid itself got corrupted. I saw two times in my VFP experience this mysterious grid bug: when cell gets a focus it becomes empty. I tried twice to debug this situation and had to kill the grid completely and rebuilding from scratch and it worked Ok. I understand that it looks like fairy tale, but it was really so. The interesting part of my experience was that any normal grid dropped to this from became bugged at once, i.e. something corrupted on form level, and form itself should be rebuilt from scratch.
><<
>
>PROBLEM SOLVED! -- Workaround anyway.
>I solved the problem another way. I added a column to my lookup cursor with the key defined as n(12,2). So now my lookup cursor has 3 columns, the descr, the integer key and the numeric key. In the GotFocus of the Combo I change the BoundColumn to 3. In the LostFocus of the Combo I change the BoundColum back to 2.
>
>I, too have been bitten by the corrupt form/class..... That is why I created the test program I submitted in my first message. Out of curiosity, did you try that program??
>
>Just to make sure I understand your suggestion properly.
>In a grid, the ControlSource for the column/combo is an integer.
>The RowSource for the Combo is a Character.
>This ListIndex does not equal the BoundColumn value.
>BoundTo is .T.
>The proper values show up for you whether or not the combo has focus?
>
>Would you mind posting a ClassBrowser output or something detailing your solution? I hate to leave things like this unresolved, especially since my solution seems SO kludgey. I will also create another new form using my data and try again.
>
>Thanks for your help.
>Bill

Basically, it is. The only thing that I populated combo by characters using AddItem (to speed up testing).
Foolowing is from class browser:
ADD OBJECT grid1 AS grid WITH ;
ColumnCount = 6, ;
Left = 17, ;
RecordSource = "table1", ;
RecordSourceType = 1, ;
Top = 6, ;
Name = "Grid1", ;
Column1.ControlSource = "table1.cnt", ;
Column1.Sparse = .F., ;
Column1.Name = "Column1", ;
Column2.ControlSource = "table1.id", ;
Column2.Name = "Column2", ;
Column3.ControlSource = "table1.year", ;
Column3.Name = "Column3", ;
Column4.ControlSource = "table1.memo", ;
Column4.Name = "Column4", ;
Column5.ControlSource = "table1.gen", ;
Column5.Name = "Column5", ;
Column6.ControlSource = "table1.dummy", ;
Column6.Name = "Column6"

ADD OBJECT form1.grid1.column1.combo1 AS combobox WITH ;
Height = 24, ;
Left = 0, ;
Style = 2, ;
Top = 53, ;
Width = 100, ;
BoundTo = .T., ;
Name = "Combo1"
PROCEDURE combo1.Init
for n=10 to 1 step -1
this.additem(alltrim(str(n)))
endfor
ENDPROC

Table1.cnt is Integer containing various values from 1 to 10. I specifically filled combo in reverse order to eliminate ItemId confusions.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform