procedure TFmfilialinfo.DBGrid1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
if (gdfocused in state) and (column.FieldName='出生年月') then
begin
DateTimePicker1.SetBounds(rect.Left + dbgrid1.Left + 1,rect.Top + dbgrid1.Top +1,
rect.Right - rect.Left ,rect.Bottom -rect.Top);
end;
end;
procedure TFmfilialinfo.DateTimePicker1CloseUp(Sender: TObject);
begin
adotable1.edit;
adotable1.fieldbyname('出生年月').value:=DateTimePicker1.datetime;
DateTimePicker1.Visible :=false;
end;
procedure TFmfilialinfo.DBGrid1ColEnter(Sender: TObject);
begin
if dbgrid1.Columns [dbgrid1.SelectedIndex ].FieldName ='出生年月' then
DateTimePicker1.Visible :=true
else
DateTimePicker1.Visible :=false;
end;
已经解决