I am using the AdvStringGrid with a text filter.
In a certain situation, the first rows content gets invisible when applying a filter.
When I click on the row, the content is visible again.
I could narrow it down to this situation:
- Option << goRowSelect
- Look = glStandard (or glSoft, ...)
- calling ClearRowSelect or HideSelection
Here is some code to reproduce:
Fill the grid:
grid1->Options << goRowSelect;
grid1->Look = glStandard;
// Fill
grid1->ClearAll();
grid1->RowCount = 15;
grid1->ColCount = 3;
grid1->FixedRows = 1;
grid1->FixedCols = 0;
grid1->RandomFill(false, 1000);
grid1->ClearRowSelect();
// grid1->HideSelection();
Applying a filter from a TEdit :
void __fastcall TForm_Main::btnFilterClick(TObject *Sender)
{
grid1->FilterActive = false;
grid1->Filter->Clear();
if (!edtFilter->Text.IsEmpty())
{
TFilterOperation filterOps = foAND;
for (int i = grid1->FixedCols; i < grid1->AllColCount; i++)
{
Advgrid::TFilterData* filter = grid1->Filter->Add();
filter->Condition = "*\"" + edtFilter->Text + "\"*";
filter->Column = i;
filter->CaseSensitive = false;
filter->Operation = filterOps;
filterOps = foOR;
}
grid1->FilterActive = true;
}
}