Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box on a Grid

Status
Not open for further replies.

grads

Programmer
Feb 2, 2001
11
0
0
US
Hi,

I need some help and nobody in my office seems to know why this isn't working. I have a DataEntry grid and within one of the columns I have Cbobasedropdown Combo Box. On the properties of this combo box I have Rowsource Type set to 1-Value and in the Rowsource I have 3 values; SELL,BUY,LOAN and they are separated by commas. I also have column count set to 1 and set columnwidths to 100. When I run my form I run a program that populates the grid and I have an "Add" button so as to add a new record to the grid. When I click the "Add" btton I can see the combo box in the grid but when I click on it there are no values in the drop down portion. When I create this combo box on the form itself it works fine and the column width of the field in the table is wide enough to accomodate these values. I would greatly appreciate any help anyone could give me on this. Thank you
 
I'm not sure what the problem could be. It worked for me. Here's what I did:
Code:
Create Table Test (name c(5),type c(4))
I created a form, opened the data environment, added my Test table to it, and dragged the table onto the form to create a grid. I added a combobox to the form, cut it from the form, pasted it into Column2 of the grid, then deleted the text box from Column2. I set the RowSource of the combobox to "SELL,BUY,LOAN" (without the quotes), and set RowSourceType to "1 - Value". In the Click() event of the button, I put the code:
Code:
APPEND BLANK
thisform.grdTest.setfocus()
I ran the form, clicked the button, and the pull-down ComboBox had the 3 values in it.

Try following exactly what I did and see if it works for you.
 
Did the same as chpicker and wasn't able to reproduce faulty behavior. Are you using a sub class of the combo control. If yes, check the custom methods.

Hope this helps

Jean
 
Thank you two for your efforts. I got it kind of working but not really. That way of doing it works but we use some thing called Visual Maxframes and I have to use that data entry grid. I did hack into the grid created by dragging the table onto the form and convert it into the grid I need to use and it works but if I make one change I gett errors telling me a member class has been removed. I'm going to play around with it and see what I come up with.

Thanks so much.
 
I got it working! It turns out that when I set the Rowsource and value in the properties of the combo box somehow Foxpro is not reading it but when I set those properties programmatically in the ShellAdditionalInit it works fine. I don't know why it didn't work the other way but at this point I just don't care. Thanks everyone for you help.
 
Most likely there is code somewhere that is changing the values you placed there. Using custom controls that you didn't write can be quite frustrating in that regard. :eek:(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top