View Issue Details

IDProjectCategoryView StatusLast Update
0037357LazarusLCLpublic2020-07-16 08:25
ReporterEmil Totev Assigned To 
Status newResolutionopen 
Summary0037357: TDBGrid.Option dgAnyButtonCanSelect not working properly
DescriptionWhen this option is set, right-click moves the selection as advertised in the documentation, but does not un-select what was selected with a left-click.
Steps To ReproduceIn my case I have also set Options dgMultiselect and dgRowSelect to true, and I observe the following behaviour:

Left click selects the clicked record and un-selects any other
First right-click selects the clicked record, but doesn't un-select the currently selected record (2 records selected)
Next rIght-clicks on different records select the clicked record and un-select the previously selected by right-click record. The record initially selected by left-click stays selected (again two records selected)
Additional InformationThe following patch at around line 2825 in DBGrids.pas seems to fix the problem for me:

          else begin
- if Button=mbLeft then
- ClearSelection(true)
+ if (Button=mbLeft) or (dgAnyButtonCanSelect in Options) then
+ ClearSelection(true);
            // Select row before popupmenu
- else
              if (Button=mbRight) and Assigned(PopupMenu) and not FSelectedRows.CurrentRowSelected then
TagsNo tags attached.
Fixed in Revision
Attached Files


Bart Broersma

2020-07-15 21:16

developer   ~0124063

@Emil: please take care where (in which category) you post your bugreports.

Emil Totev

2020-07-15 21:26

reporter   ~0124064

I am sorry if I posted in the wrong category (or was it wrong project?) - would you point me to a good explanation of what is what and what must go where? Especially the difference between Lazarus and Lazarus CCR? I thought 'Lazarus' was for the IDE, and 'CCR' - for the components like LCL.

Bart Broersma

2020-07-15 23:00

developer   ~0124069

@Emil: Lazarus is anything that comes with a standard Lazarus distribution (minus the compiler)
Lazarus-CCR is the Lazarus Code and Component Repository. It contains code and component examples. They do not come with Lazarus itself. You will have to download and install them separately, so you probably know if you did so.

Emil Totev

2020-07-16 08:25

reporter   ~0124074

Thanks, now I understand a little better... Part of my confusion comes from the fact that the LCL reference lives at
It would be nice if there were a page clearly describing what the different projects and categories are.

Issue History

Date Modified Username Field Change
2020-07-15 08:32 Emil Totev New Issue
2020-07-15 21:16 Bart Broersma Project Lazarus CCR => Lazarus
2020-07-15 21:16 Bart Broersma Note Added: 0124063
2020-07-15 21:26 Emil Totev Note Added: 0124064
2020-07-15 23:00 Bart Broersma Note Added: 0124069
2020-07-16 08:25 Emil Totev Note Added: 0124074