Lazarus

Programming => Databases => Topic started by: artem101 on September 19, 2020, 05:22:20 pm

Title: Show cell editor only when left mouse button clicked in TDBGrid
Post by: artem101 on September 19, 2020, 05:22:20 pm
I have AutoEdit option in my DBGrid enabled and editor appears on either right or left mouse button double click. This is not very suitable for me, because I have context menu on right button. Is it possible to enter cell`s editor only with left button?
Title: Re: Show cell editor only when left mouse button clicked in TDBGrid
Post by: Blaazen on September 19, 2020, 05:39:28 pm
Do you have goAlwaysShowEditor in Options?
Title: Re: Show cell editor only when left mouse button clicked in TDBGrid
Post by: artem101 on September 19, 2020, 07:23:01 pm
Do you have goAlwaysShowEditor in Options?
No.


Only these options enabled:
Quote
[dgEditing,
dgTitles,
dgIndicator,
dgColumnResize,
dgColumnMove,
dgColLines,
dgRowLines,
dgTabs,
dgAlwaysShowSelection,
dgConfirmDelete,
dgCancelOnExit,
dgAnyButtonCanSelect,
dgCellEllipsis]
Title: Re: Show cell editor only when left mouse button clicked in TDBGrid
Post by: artem101 on September 22, 2020, 02:33:26 pm
Is it possible to get pressed mouse button in SelectEditor event and set editor to nil like this:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.ItemsGridSelectEditor(Sender: TObject; Column: TColumn;
  2.   var Editor: TWinControl);
  3. begin
  4.   if IsRightButtonPressed() then
  5.      Editor := nil;
  6. end;  
TinyPortal © 2005-2018