LCL: fix TDBRadioGroup value not set when not in editmode, from Erwin van den Bosch, issue #25754

git-svn-id: trunk@49214 -
This commit is contained in:
jesus 2015-05-29 18:45:44 +00:00
parent bda023911d
commit bbb037cc27

View File

@ -124,16 +124,19 @@ end;
procedure TDBRadioGroup.UpdateRadioButtonStates;
var
OldValue: String;
NewValue: String;
SettingValue: boolean;
begin
OldValue:=Value;
inherited UpdateRadioButtonStates;
SettingValue := FInSetValue;
Value := GetButtonValue(ItemIndex);
if (Value<>OldValue) and FDatalink.CanModify and not SettingValue then
NewValue := GetButtonValue(ItemIndex);
if (NewValue<>OldValue) and FDatalink.CanModify and not SettingValue then
begin
if FDatalink.Edit then // ensure that we are in edit state
FDataLink.Modified
if FDatalink.Edit then begin // ensure that we are in edit state
FDataLink.Modified;
Value := NewValue;
end
else
DataChange(Self);
end;