[Lazarus] TDbGrid and multiselect

Luca Olivetti luca at wetron.es
Tue Jul 8 00:59:01 CEST 2008

En/na Jesus Reyes ha escrit:

> It looked to me useful to have persistent selection where you can browse with mouse or keyboard to other section of dataset. Because SelectedRows if public it just need a dbgrid.SelectedRows.Clear operation after processing the selected rows. But I think we can make this delphi compatible if you or somebody provides a spec for this feature.

I can only say what my ancient version of delphi does:

1) the current row is part of the selection (e.g. if I used TRxDbGrid it 
has both the triangle and the dot, and SelectedRows.count is 1) (under 
Lazarus SelectedRows.count is 0)

2) shift-click extends the selection from the previously selected row to 
the new one (under lazarus shift click is no different than plain click)

3) ctrl-click add the new clicked row to the selection (this works the 
same under lazarus)

4) shift-arrow up or shift-arrow down extends the selection one row at a 
time (or remove it if you go the opposite way) (under lazarus there's no 
difference between arrows with or without shift)

5) selecting a row without shift or control clears the selection (well, 
actually it reduces it to the current row, see 1) (under lazarus the 
selection is untouched)

It's quite similar to what a TStringGrid currently does under lazarus 
when you activate RangeSelect, but you can also select non-contiguous 
rows with ctrl-click.

I can work-around 1) in my code (but then my code will break if TDbGrid 
is made delphi compatible) and the rest in the documentation (those that 
will be using the new program are used to the delphi behavior, so I'll 
have to explain to them that this program behaves differently).

Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004      Fax +34 93 5883007

More information about the Lazarus mailing list