Hello,
After some testing I think the sorting and/or filtering problems I have could be related with the way I manage the color of certain rows.
In my DataSet I can have a special column named KOLOR, not visible.
I use the event OnDrawColumnCell of the grid. There I check if the field KOLOR has a color asigned. In that case I assign the color to the cells of that row:
Code:
if (useColors)
{
TFont *TipoLetra= DBGridEh1->Canvas->Font;
String sColor= MemTableEh1->FieldByName(NombreCampoColor)->AsString;
TColor color= clBlack;
if (sColor== "clAqua")
color= clAqua;
else...
TipoLetra->Color= color;
DBGridEh1->DefaultDrawColumnCell(Rect, DataCol, Column, State);
}
When testing sorting/filtering sometimes I found the colored rows are not affected (for example they appear in the grid when they shouldn't).
Could you tell me if I am doing something wrong or if there is a better way of setting row colors based in the value of a field in the DataSet?.
Thank you very much in advance.
Edorta.