RXDBGrid - fix clear cell with date format in RxDBGrid

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2810 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2013-10-28 08:06:33 +00:00
parent 6e41b14320
commit 1e92c08d23

View File

@ -1136,6 +1136,8 @@ end;
{ TRxDBGridDateEditor } { TRxDBGridDateEditor }
procedure TRxDBGridDateEditor.Change; procedure TRxDBGridDateEditor.Change;
var
D:TDateTime;
begin begin
inherited Change; inherited Change;
if Assigned(FGrid) and FGrid.DatalinkActive and not FGrid.EditorIsReadOnly then if Assigned(FGrid) and FGrid.DatalinkActive and not FGrid.EditorIsReadOnly then
@ -1148,7 +1150,12 @@ begin
FGrid.SelectedField.Clear; FGrid.SelectedField.Clear;
if FGrid <> nil then if FGrid <> nil then
FGrid.SetEditText(FCol, FRow, Text); begin
if TryStrToDate(Text, D) then
FGrid.SetEditText(FCol, FRow, Text)
else
FGrid.SetEditText(FCol, FRow, '');
end;
end; end;
end; end;