Hi TMS Support,
I have a "dbadvgrid" that display data. I have 10 records in the grid. I select the last record and use the line "showmessage(dbadvgrid1.RealRowIndex(dbadvgrid1.SelectedRow[0]).tostring);" to display the readrowindex. It show "10". After that, I use the line "dbadvgrid1.NarrowDown(edit1.Text);" and it filters my grid that only shows the last record (filter text = "3757"). After that, I click on the same record and use the same line to display the realrowindex and it shows "8" ?
I dont' understand, because it's the same record.
Thanks for the help.
Did you set grid.PageMode = false?
With this setting, I could not reproduce such issue here.
If a problem persists, please provide a sample source project with which this can be reproduced via email to support.
Hi,
We received it and we'll investigate as soon as possible.
Hi Bruno,
Thanks for the answer to my email and it works well, but I got another question.
I want to get the "rowcount" after the narrowdown, so my grid is "filtered" and I want to have the "rowcount". Is there any way to get this information ?
I already try "grid.RowCount", "grid.TotalRowCount", grid.AllRowCount". But none of this give me the right information.
Example: my grid got 3000 records, so the "rowcount" is ok. If I "narrowdown" and then there's only 150 records visible in my grid, the "rowcount" don't give me the right information.
Thanks for your help
We'll add a new property grid.FilteredRows: integer for this in the next update.
Workaround for now:
var
numrows: integer;
numrows := grid.RowCount;
for i := grid.FixedRows to grid.RowCount - 1 do
if grid.IsSuppressedRow(i) then
dec(numrows);
end;
Thank you Bruno, it works great again :)
Is there a problem with the scroll too ? There's like 165 records in my grid and when I scroll with the mouse, I see the scrollbar moving but the grid is static. It's like if the grid scroll every records, not only the filtered records ?
I could not reproduce an issue with scrolling here.
Do you have more details?
I've got a dataset with like 1500 records displayed in the grid. If I scroll down with my mouse, everything is ok. The scrollbar goes down and I see the grid going down too.
I use "narrowdown" to filter the grid and it results 242 records in the grid.
If I scroll down with my mouse, the scrollbar always go down, but sometimes the grid stop to go down while the scrollbar continue to go down.
I hope that you understand, sorry for my english!!!
I retested this with a default grid on the form where a filter is applied to retain somewhere between 200 and 250 rows from 1500 rows in total but I cannot see the phenomenon you describe:
begin
advstringgrid1.RowCount := 1500;
advstringgrid1.RandomFill(false,6);
advstringgrid1.FilterType := ftSuppress;
advstringgrid1.NarrowDown('1',1);
caption := advstringgrid1.FilteredRows.ToString;
end;
I try your code and it works, but I found the problem. It's when I set the propertie "WheelAction = waScroll". Now you can see that sometimes, when you scroll the scrollbar goes down but the grid didn't move.