Ver Mensaje Individual
  #2  
Antiguo 23-09-2004
Avatar de marcoszorrilla
marcoszorrilla marcoszorrilla is offline
Capo
 
Registrado: may 2003
Ubicación: Cantabria - España
Posts: 11.221
Reputación: 10
marcoszorrilla Va por buen camino
Puedes incrustar un DateTimePicker encima de la rejilla con la propiedad visible a falso y luego con este código que pongo de ejemplo ir mostrándolo y modificando la fecha sin ningún problema.
Código Delphi [-]
 
 procedure TForm1.DBGrid1ColEnter(Sender: TObject);
 begin
   if DbGrid1.Columns [DbGrid1.SelectedIndex].
   Field = Table1Saledate   then
   DateTimePicker1.Visible := True
   else
   DateTimePicker1.Visible := False;
 end;
 
 procedure TForm1.DateTimePicker1Change(Sender: TObject);
 begin
 Table1.Edit;
 Table1Saledate.Value:=Trunc(DateTimePicker1.Date);
 end;
 
 procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
   DataCol: Integer; Column: TColumn; State: TGridDrawState);
 begin
   if (gdFocused in State) and
     (Column.Field = Table1Saledate) then
   begin
     DateTimePicker1.SetBounds (
       Rect.Left + DBGrid1.Left + 1,
       Rect.Top + DBGrid1.Top + 1,
       Rect.Right - Rect.Left,
       Rect.Bottom - Rect.Top);
 
   DateTimePicker1.Date:=Trunc(Table1Saledate.Value);
   end;
 end;

Un Saludo.
__________________
Guía de Estilo de los Foros
Cita:
- Ça c'est la caisse. Le mouton que tu veux est dedans.
Responder Con Cita