Board index » delphi » DBGrid - How to select multiple rows in a DBGrid.

DBGrid - How to select multiple rows in a DBGrid.

My sincere apologies if this posting does not belong here.

I have a DBGrid on my form. When data is displayed on the grid, the users
would like to leftclick the mouse on one row, drag it to a different row and
in the process select all rows between the two. How do I accomplish this?
Setting dgMultiSelect to 'True' allows you to select multiple rows, but only
one row at a time using the mouse and control key. The user wants to select
a set of consecutive multiple rows using just the mouse left click.
Also, within the code, how do I access the selected rows one by one?

Thanks for any help.
-- M

 

Re:DBGrid - How to select multiple rows in a DBGrid.


Select a row, then hold SHIFT down while selecting the bottom row in the
group you want to have selected, this will select all rows in-between as
well.

Quote
"Srinivas Chundi" <nos...@hotmail.com> wrote in message

news:3da07e92@newsgroups.borland.com...
Quote
> My sincere apologies if this posting does not belong here.

> I have a DBGrid on my form. When data is displayed on the grid, the users
> would like to leftclick the mouse on one row, drag it to a different row
and
> in the process select all rows between the two. How do I accomplish this?
> Setting dgMultiSelect to 'True' allows you to select multiple rows, but
only
> one row at a time using the mouse and control key. The user wants to
select
> a set of consecutive multiple rows using just the mouse left click.
> Also, within the code, how do I access the selected rows one by one?

> Thanks for any help.
> -- M

Re:DBGrid - How to select multiple rows in a DBGrid.


Associate an auxiliary component TtaoDBGrid (see the link below) with your
grid and the user will be able to range-select with Shift+Click. If you
need mouse selection, use the TDBGrid.MouseCoord method and the
OnMouseMove event. Access selected rows as TDBGrid.SelectedRows.

--
Andrei Fomine    www.quasidata.com
DbAltGrid - multi-line layout, RTF and graphics of any kind in DBGrid.
Transfer@once - full-blown clipboard and drag-and-drop data transfer
to/from any control in many formats, including ones native to MS Office.

Quote
"Srinivas Chundi" <nos...@hotmail.com> wrote in message

news:3da07e92@newsgroups.borland.com...
Quote
> My sincere apologies if this posting does not belong here.

> I have a DBGrid on my form. When data is displayed on the grid, the
users
> would like to leftclick the mouse on one row, drag it to a different row
and
> in the process select all rows between the two. How do I accomplish
this?
> Setting dgMultiSelect to 'True' allows you to select multiple rows, but
only
> one row at a time using the mouse and control key. The user wants to
select
> a set of consecutive multiple rows using just the mouse left click.
> Also, within the code, how do I access the selected rows one by one?

> Thanks for any help.
> -- M

Other Threads