Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Selecting lines in the grid
Fri, Mar 16 2018 11:23 AMPermanent Link

Matthew Jones

What are the ways that I can select lines in the grid, so that I can then operate on the rows selected (to delete, or to update)?

Ideally I need a checkbox that is single select.

Is this available in any form today?

Is there anything in v3 that will change it, and in any short timescale?

Thanks,

--

Matthew Jones
Fri, Mar 16 2018 4:31 PMPermanent Link

erickengelke

Avatar

"Matthew Jones" wrote:

>What are the ways that I can select lines in the grid, so that I can then operate on the rows selected (to delete, or to update)?

>Ideally I need a checkbox that is single select.

>Is this available in any form today?


You can do it in a couple of different ways.


Setting TGrid's  RowSelect option will make it only select whole rows at a time.
And then you cen call the functions to delete or update or whatever.

Another thing you can do is add a checkbox field to the grid and dataset, and then have a button which Deletes Selected by doing something like:

  dataset1.Last;
  while not DataSet1.BOF do begin
      if dataset1.columns.column['mycheckbox'].AsBoolean then dataset1.Delete;
     dataset1.Prior;
 end;


Erick

--

Matthew Jones
http://www.erickengelke.com
Image