AdvStringGrid - filtering und row counting

Hello,
how can i get the number of filtered rows?
Best regards
Marco.

Please check with grid.NumHiddenRows:integer;

Hello,
Thanks for the answer. It works fine in AdvStringGrid.
Why i coudn't find DBAdvGrid.NumHiddenRows?
Best regards
Marco.

I have no idea why you can't find it, it is there. TDBAdvGrid descends from TAdvStringGrid so automatically inherits this property.

Hello,
OK, the property is available at designtime, but the value is ever 0, with filter active or not.
During debugging the IDE don't known NumHiddenRows, other properties (like RowCount or FixedRows) are available.
Best regards,
Marco.

I have no idea what you see, but this is not a design time property and the property is a public property and is available at runtime.

Hello,
thanks for the reply.
There was a logical problem in my code. Sorry
Best regards
Marco.

How can I know the number of rows in the advstringgrid after using the filter?

For example, Total records: 20 out of 100, where 20 is from the filter and 100 is the total of the data loaded.

NumHiddenRows is returning 0 (zero)

Thank you

grid.RowCount returns nr. of visible rows
grid.TotalRowCount returns total number of rows

Good morning, how are you?

I tested both sgMonGrid.TotalRowCount and sgMonGrid.RowCount, and they returned the same number of rows.

procedure TfConsultaSGI.sgMonGridFilterDone(Sender: TObject);
var
totalLinhas, linhasFiltradas, i: Integer;
begin
// Contar a quantidade total de linhas
{totalLinhas := sgMonGrid.RowCount - 1; // Exclui a linha do cabeçalho

// Contar a quantidade de linhas filtradas
linhasFiltradas := 0;

for i := 1 to sgMonGrid.RowCount - 1 do
begin
if not sgMonGrid.IsHiddenRow(i) then
Inc(linhasFiltradas);
end;}
// Exibir os resultados
ShowMessage('Total de linhas: ' + IntToStr(sgMonGrid.TotalRowCount) +
', Linhas filtradas: ' + IntToStr(sgMonGrid.RowCount));
end;

https://drive.google.com/file/d/13287ATg7W0BJmR2p87ztlpC6VpEozxMJ/view?usp=share_link

What is the setting for grid.FilterType?
If this is ftSuppressed, you might need to use grid.NumSuppressedRows to get the number of suppressed rows by filtering.

Now I followed your tip and it worked, thank you very much.