Welcome to the new platform of Programmers 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 it's 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.
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.