DBCtrls: Workaround for TDBRadioGroup being changable even if Dataset is readonly, patch by Soner (issue #31993).

git-svn-id: trunk@55344 -
This commit is contained in:
wp 2017-06-13 11:45:01 +00:00
parent faae3723fa
commit 13abe9d021

View File

@ -139,6 +139,14 @@ begin
end
else
DataChange(Self);
end
// Workaround for TDBRadiogroup not having a ReadOnly property (i.e. ItemIndex
// can be changed even if Dataset is ReadOnly)
// See isse https://bugs.freepascal.org/view.php?id=31993
else if (not DataLink.CanModify) and (DataLink.Field.AsString <> NewValue) then
begin
FValue := ''; // Otherwise, SetValue in next line would exit immediately
Value:= OldValue;
end;
end;