Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: TStringGrid.OnClick Ummm, where'd it go?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Dec 16, 2016 3:13 PM Last Post By: Dave Nottage
Michael Leahy

Posts: 239
Registered: 5/9/07
TStringGrid.OnClick Ummm, where'd it go?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 16, 2016 12:41 PM
I'm migrating a project from XE7 to Berlin.

Berlin links and runs the code but then abends with...

Property OnClick does not exist.

Sure enough, TStringGrid in XE7 has a click handler. Berlin does not.

What's the "new way" of handling user clicks in cells of a TStringList?
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: TStringGrid.OnClick Ummm, where'd it go?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 16, 2016 12:53 PM   in response to: Michael Leahy in response to: Michael Leahy
Michael Leahy wrote:
I'm migrating a project from XE7 to Berlin.

Berlin links and runs the code but then abends with...

Property OnClick does not exist.

Sure enough, TStringGrid in XE7 has a click handler. Berlin does not.

What's the "new way" of handling user clicks in cells of a TStringList?

Have you tried OnSelectCell?

OnClick is still there, just public instead of published. So you can either
inherit your own and publish it or set it at runtime. I do not know what it is
no longer published so you will have to test if it still works. I don't see any
extra code around OnClick other than publishing it so I exepct it should work
still as before, but I didn't look too deep.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: TStringGrid.OnClick Ummm, where'd it go?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 16, 2016 3:13 PM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
Jeff Overcash (TeamB) wrote:

What's the "new way" of handling user clicks in cells of a TStringList?

Have you tried OnSelectCell?

That'd be my answer, too. OnSelectCell also allows you to:

* Know which cell was clicked
* Control whether the cell actually becomes selected.

Using OnClick would be more work.

--
Dave Nottage [MVP, TeamB]
Hints, tips and tricks at: http://www.delphiworlds.com/blog
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02