Subject | Re: [IBO] Accessing SELECTED rows in a grid |
---|---|
Author | Florian Hector |
Post date | 2004-01-08T06:45:53Z |
>What you have to do, is to loop through your dataset to see if one ore more records are selected. If
> Sorry Florian, but IB_Query1.selected[I] don't change the actual
> record I think, only test if RecNO gived is or not Selected...
> I need first to PUT in this ROW before check any field.
>
the record is selected, then do something with it. In code, it looks like this:
MyQuery.First;
while not MyQuery.Eof do
begin
if MyQuery.Selected[i] = True then
begin
MyQuery.FieldByName('String1').AsString := 'FooBar';
MyQuery.FieldByName('String2').AsString := 'BarFoo';
MyQuery.Post;
inc(j);
end;
qryFestBestell.Next;
inc(i);
end;