Solved

OnMouseUp event missing from TDBGrid

Posted on 1997-06-18
1
441 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month8 days, 7 hours left to enroll

617 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