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!

Grid Woes

Status
Not open for further replies.

spuppett

Programmer
Jan 25, 2003
48
0
0
US
VFP (6.0) isn't making much sense to me today (or ever, really). I have a legacy prg I'm adding to. I've added a grid to a form with 2 columns, and a combo box to that grid in the first column. I need to populate the combo box with a list from a table. There are 3 items in the DB right now and what happens is this:

In the comboBox init I open the table, scan through it and .addItem. When the form shows and I look on the grid, there are 3 rows of the grid filled in, with the combobox text set to the first, second, and third one, respectivly. If I change the second row's text to the thirds text, it changes it in the table.

I don't want these to change ever, just read from the table, which is part of the reason I didn't bind the grid control to a table. I don't know what to do. Any one have any thoughts.
 
If you don't want the data to change, why use a combo? Why not just use a textbox that shows the right value?

Tamar
 
Maybe an example would be better.
Code:
table:
Advance
Equipment
Reimbursement
In the form I have
Code:
  type             amount
----------------------------
|Advance       ^|          |
----------------------------
|Equipment     ^|          |
----------------------------
|Reimbursement ^|          |
----------------------------

What I'm looking for is the first column(the combo box) to have 'Advance' in the first row only. All three of the combo boxes have 'Advance', 'Equipment', and 'Reimbursement' in them. If I change 'Equipment' to 'Advance', my table then looks like this:

Code:
Table:
Advance
Advance
Reimbursement

Basically I want my table to be read-only (which I've tried to no avail) so that it only fills the combo box.

Thanks for your time.
 
I'll ask the same question. Why are you using a combobox in column 1 instead of a textbox?

Tamar
 
The user selects the type of payment from the combo box, enters the amount and when they are done with the form, that grid gets entered into a different table.
 
I don't understand. Either the user can change the combo value or not.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top