AdvStringGrid - RowModified/Filter

Hello Team,



there's an issue about RowModified in AdvStringGrid, when Filtered.



If you filter Code below for "A", then edit Col3 on all Rows, and then press the button, only the top rows get "demodified", the rows at bottom do not. One would expect that all rows get "demodified". It seems that the RowCounter checks only the filtered Count of rows for modification.





procedure TForm5.FormCreate(Sender: TObject);

begin

AdvStringGrid1.Cells[1,1]:='A';

AdvStringGrid1.Cells[1,2]:='B';

AdvStringGrid1.Cells[1,3]:='A';

AdvStringGrid1.Cells[1,4]:='B';

AdvStringGrid1.Cells[1,5]:='B';

AdvStringGrid1.Cells[1,6]:='B';

AdvStringGrid1.Cells[1,7]:='A';

AdvStringGrid1.Cells[1,8]:='A';

AdvStringGrid1.Cells[1,9]:='B';

end;



procedure TForm5.Button1Click(Sender: TObject);

var

LocZaehler: Integer;

begin

for LocZaehler := 0 to AdvStringGrid1.RowCount-1 do

   begin

     AdvStringGrid1.RowModified[LocZaehler]:=False;

   end;

end;



Thanks for Feedback.



Regards, Tom

Please change your code to:


procedure TForm1.Button1Click(Sender: TObject);
var
  LocZaehler: Integer;
  rr: integer;
begin
  for LocZaehler := 0 to AdvStringGrid1.RowCount-1 do
  begin
    rr := advstringgrid1.RealRowIndex(LocZaehler);
    AdvStringGrid1.RowModified[rr]:=False;
  end;
   AdvStringGrid1.Invalidate;
end;

In the next update, we've applied an improvement that will make the Invalidate call no longer needed.

Hi Bruno,



thanks for your fast reply. That fixed the issue in my application.



Regards, Tom