Buenas, he puesto eso que me dices, he cambiado algunas cosillas porque las fechas están en la base de datos y hago la llamada al campo de la tabla. Me da un error que no sé solucionar. El error dice:
Proyect Promociones.exe raised exeception class EConvertError with message "' is not valid date'. Process stopped. Use Step or Run to continue.
La modificación que hice:
Código:
void __fastcall TXVista::StringGrid1DrawCell(TObject *Sender, int ACol,
int ARow, TRect &Rect, TGridDrawState State)
{
TCanvas *CV = static_cast<TCanvas*>(StringGrid1->Canvas);
TDate FechaCell = StrToDate(StringGrid1->Cells[0][ARow]);
while(!XDatos->QCatalogos->Eof)
{
if (FechaCell >= XDatos->QCatalogosFecha_ini->Value && FechaCell <= XDatos->QCatalogosFecha_fin->Value)
{
CV->Brush->Color = clLime;
CV->FillRect(Rect);
CV->TextOut(Rect.Left+1,Rect.top+1,StringGrid1->Cells[ACol][ARow]);
}
XDatos->QCatalogos->Next();
}
}