JvDBGrid & JvDBUltimGrid: problem when trying to open EditControl with mouse click #174
Bodenseematze
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have the problem, that I'm unable to click in a grid cell with the mouse to edit the content.
When I left-click it opens and keeps it until I release the mouse button again - then it closes the edit again;
doing the same by keyboard (F2) works...
I think it happens in procedure TJvDBGrid.MouseUp because sending the WM_HSCROLL event closes the edit control...
After changing the code as follows (line 2885ff in JvDBGrid.pas), it works for me:
if ( dgRowSelect in Options ) then begin //ADDED
OriginalScrollInfo.cbSize := SizeOf(OriginalScrollInfo);
OriginalScrollInfo.fMask := SIF_POS;
// Store scrollbar position
GetScrollInfo(Handle, SB_HORZ, OriginalScrollInfo); //
end; //ADDED
LockWindowUpdate(Handle);
try
inherited MouseUp(Button, Shift, X, Y);
if ( dgRowSelect in Options ) then begin//ADDED
Perform(WM_HSCROLL, MakeWParam(SB_THUMBPOSITION, OriginalScrollInfo.nPos), 0); //Repos
end; //ADDED
finally
LockWindowUpdate(0);
end;
I'm not sure if this change has side effects - but it seems to solve the issue!
Beta Was this translation helpful? Give feedback.
All reactions