Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

A problem on making a StringGrid enabled/disabled.

Hi!

I meet a problem on making a StringGrid which is enabled/disabled under different circumstance. Initially it should be disabled(I made it enabled in object inspector, but initialed it by some code). However, when I run the program, I found the upper-left-coner cell can be edited if I type character immediately. If I select another cell, it will not be editable, then if I go back to upper-left-coner cell, it becomes not editable.

After kicking around with the program, I guessed that's because when the Grid was create, the upper-left-coner was automatically selected, and the value "True" of goAlwaysShowEditor option make the upper-left-coner cell editable, even at that time the Grid was disabled.

Then I gave a "False" to goAlwaysShowEditor in object inspected, and only add it to Options by code whenever user need to input data by Grid. It seems works well to pervent user from typing characters in at the unexpected time.

The problem seems solved, but I just post it to see if there is any related ideas or better solutions.

Thank you!
Sign In or Register to comment.