1

I have a gridview which is connected to a TAdoQuery.

I would like to change the values of a column for all the rows that I have filtered out. Something like "check all" so it changes all the values for a column called "active" to True.

How would I do this?

Let's say I have something like

qry.filter := some filters here;
qry.filtered := true;

How can I change the values in the column "active" for all the filtered results like:

for 0 to qry.count -1 do
   qry.filtered.column(active) := True;
bummi
  • 27,123
  • 14
  • 62
  • 101
Joe
  • 2,675
  • 3
  • 21
  • 26
  • 1
    AFAIK, using the query, the only way will be iterating each one of them. If your query returns many data, the faster way would be grab all the keys and perform an update, directly to the database. – EProgrammerNotFound Nov 26 '13 at 11:22
  • 3
    Are you looking for: `qry.First; While not qry.EOF do begin qry.Edit; qry.FieldByName('active').value := true; qry.Next; end;` ? – bummi Nov 26 '13 at 11:22

0 Answers0