Solved

OnMouseUp event missing from TDBGrid

Posted on 1997-06-18
1
440 Views
Last Modified: 2008-03-06
The TDBGrid has an OnKeyUp event but there is no OnMouseUp event.  How can
I tell if the user has moved into a differant row using the scroll bar?  The OnColEnter event doesn't work since the column is the same.  The OnMouseUp event for the form only works if the form has focus.
0
Comment
Question by:mkaminski
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
ronit051397 earned 100 total points
ID: 1337187
Use the event 'OnDataChange' which is related to the datasource which is connected to the dbgrid.
Each time another record becomes the current  record, either by user selection or by doing something in your code, this event occurs. to treat changing the current record only by user selection you can write the following:

procedure TForm1.DataSource1DataChange(Sender: TObject; Field: TField);
begin
  if DBGrid1.Focused then  //if the user selected another record
  begin
  ...............
  end;
end;

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question