Ver Mensaje Individual
  #3  
Antiguo 30-10-2012
borlandpablo borlandpablo is offline
Miembro
NULL
 
Registrado: oct 2012
Posts: 37
Reputación: 0
borlandpablo Va por buen camino
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();
  }
}
Responder Con Cita