BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

strange behavior of DBGrid and mouse wheel in Delphi 5

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using
View previous topic :: View next topic  
Author Message
Chris Luck
Guest





PostPosted: Tue Nov 25, 2003 5:06 am    Post subject: Re: strange behavior of DBGrid and mouse wheel in Delphi 5 Reply with quote



"Marek" <mark*NOSPAM*@tradition.ca> wrote

Quote:
When I use MouseWheel on TDBGrid control, it moves
record selection but it does not change current record.
snip


See if this thread is any help -
http://tinyurl.com/n2p3


--
Regards,
Chris Luck



Back to top
Marek
Guest





PostPosted: Tue Nov 25, 2003 5:35 am    Post subject: strange behavior of DBGrid and mouse wheel in Delphi 5 Reply with quote



When I use MouseWheel on TDBGrid control, it moves record selection but it
does not change current record.
You can see that when you are using "indicator" column (indicator stays on
one row while selection goes to the other).
If my DBGrid works in "Master-Detail" model, the relation is broken as
moving selection does not change the current record.
In addition, the selection moves in current visible range of rows, not on
entire grid.

Could anybody explain this and ,perhaps, point out a solution ?
Thank you.



Back to top
Lester Hanger
Guest





PostPosted: Sun Nov 30, 2003 9:21 pm    Post subject: Re: strange behavior of DBGrid and mouse wheel in Delphi 5 Reply with quote




Marek <mark*NOSPAM*@tradition.ca> wrote

Quote:
When I use MouseWheel on TDBGrid control, it moves record selection but it
does not change current record.
You can see that when you are using "indicator" column (indicator stays on
one row while selection goes to the other).
If my DBGrid works in "Master-Detail" model, the relation is broken as
moving selection does not change the current record.
In addition, the selection moves in current visible range of rows, not on
entire grid.

Could anybody explain this and ,perhaps, point out a solution ?
Thank you.

I use the following in a TDBGrid descendant component:

{--- fix MouseWheel to allow scrolling of grid ---}
procedure TRDBGrid.WMMouseWheel(var Msg: TWMMouseWheel);
begin
if (DataLink <> nil) AND (DataLink.Active) then try
DataLink.DataSet.MoveBy(-Msg.WheelDelta div 120);
except;
end;
end; {WMMouseWheel}





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.