Avatar of kacor
kacor
Flag for Hungary asked on

Combobox in stringgrid

Hi,

I tested the solution of https://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20369496.html and I found the following runtime problem:

1. Click for example the second cell in the second column. Appears the combobox. Select a value in the combobox by clicking. The cell takes over the selected value.
2. Click again on this cell, and appears again in the combobox the earlier selected value. Click somewhere in the table on a cell, the cell get the focus. Then click back on the combox and select an other value. After clicking this value appears in the cell which got the focus.

I'd like to avoid this mistake. How would be possible to prevent this?

Thanks for every comment

wbr Janos
Delphi

Avatar of undefined
Last Comment
kacor

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
mokule

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
mokule

Btw
I would suggest to change the first line in form create procedure like below.
It looks better at least for me.

  StringGrid1.DefaultRowHeight := cbInplaceComboBox.Height-1;
SOLUTION
Mike Littlewood

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
kacor

ASKER
thanks guys for your quick comments, I try to test them but I have to be away for 2 days
wbr
Janos
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes