No that's not what I want. When the user clicks one cell, the row where the cell is, has to be automatically selected.
Main Topics
Browse All TopicsHello experts.
I have a TStringGrid, and I want it to select the whole row when a cell is clicked. How would I do this?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Yes, this is exactly the purpose of goRowSelect.
Thing is, when you have this option, you can't have a cell selected and the row around it selected as well but without focus, meaning you can't use the editing mode of the cell, except by changing the mode on double click for example.
In the example below, LastSelected is TPoint, and goRowSelect an goEditing should be set to true
Beleive me I tried it works. Or your question does not express what you need.
It's not perfect still, because StringGrid is probably the worst Delphi Component ever as you will soon find out. Another solution would be to do the drawing yourself with DefaultDrawing set to false and puting some code in the onDrawCell event
I have done such a thing somewhere, maybe I could find it to you tomorrow as it is 2 AM here... Tell me if you still need it and I'll see what I can find
Ok, since I'm brand new to EE community I am not yet used to this kind of reaction from the asker, but it would seem that either he is not even understanding his own question or he does not want to believe somebody who is less than a true Genius with 10 years of participation in the exchange community.
Either way, I would not mind about a 50 points question going to ashes that way, all the more because it took me only seconds to give the first answer and merely minutes to prove my point with a working code.
Still, I don't understand and I'm a bit disappointed. This helps me to understand why some other participant expert expressed some time their frustration quite rudely.
Since I was ready to give freely some nice code improving TStringGrid, I guess I will keep it for someone who really deserve it (meaning was open minded enough to ask for it when proposed)
I recommend #3, as all Delphi users who cared reading Delphi Help knows that http:#25418554 is the right answer. But http:#25419270 is also a nice trick to avoid the first problem encountered when someone wants to use TStringGrid that way.
recommendations:
http://#25418554
http://#25419270
@Cazaxx
The goRowSelect does just what you asked
>>No that's not what I want
But what do you want then ?
Providing a screenshot of what you want is most helpfull ...
Business Accounts
Answer for Membership
by: epasquierPosted on 2009-09-24 at 15:18:54ID: 25418554
In Options, put goRowSelect to True
You know there is Help in Delphi that is brilliant for this kind of questions ? ;-)