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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Curious problem - possible reasons?

Status
Not open for further replies.

CHeighlund

Programmer
Jun 11, 2007
163
US
I'm having a problem in a program I've written. I have a TStringGrid component that actually executes the major internal database loop, and a set of four database-loaded dropdown boxes that are used to specify information coming from the database.

For some reason, clicking outside of the TStringGrid component in question seems to be shifting the 'visible' item in the dropdown boxes. That is, if you needed to break the current run, or do one run with one set of data, and then try another with only one item different, all four dropdown boxes would revert to showing their top item, no matter which item was originally selected. Since I'm matching the text of the boxes against my DB search, this presents some problems.

I have a few places in my code where the dropdown boxes are cleared and reloaded, but I've had code checkpoints on them in the compiler, and the only one that's triggering is the one that loads the boxes in the first place; even it only does so that one time. There doesn't seem to be any reason for the items to shift when they do, at least as far as I can tell. To make matters worse, it doesn't always happen. The only thing that is consistent is that it occurs when I've shifted the focus off of the TStringGrid component, never under any other conditions.

Anyone have any clue why this might be happening, and what I'll need to do to prevent it?
 
Hard to tell this way. show us some relevant code.
if this involves a lot of code, try to simulate it with a new and smaller project.

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Is there a reason you're using TStringGrid instead of TDBGrid to handle your data? DBGrid has a Columns[].PickList property that you may find useful.

See if you can duplicate the problem with minimum amount of code in a small app using one of the demo tables (..\Borland Shared\Data\).

Post that code and perhaps we can more understand your problem.

For examples using TDBGrid, see one of the demo apps in ..\Delphi\Demos\Db\


Roo
Delphi Rules!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top