I have an AdvStringGrid that has 3 columns, 1 fixed row.
Column Headers: User Name, Admin Access, User Access.
Under the Admin Access and User Access columns I add a RadioButtonGroup:
AdvStringGrid1.AddRadioButtonGroup(1,i+1,rgRow,True);
AdvStringGrid1.AddRadioButtonGroup(2,i+1,rgRow,False);
Take note of the rgRow parameter.
When I run the program and use the mouse to click Admin Access or User Access, it functions as expected, i.e. when I click Admin the radio button is selected and the User radio button is de-selected and vice versa.
However, if the spacebar on the keyboard is used instead of the mouse, the behavior switches to rgCol.
So, I have tried to intercept the space key in onKeyPress, onKeyDown and onKeyUp events to make the component "ignore" space, but to no avail.
procedure TfrmEditAccessList.AdvStringGrid1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
// Caption:='Edit Access List - '+IntToStr(Key);
if Key=32 then Key:=0;
end;
procedure TfrmEditAccessList.AdvStringGrid1KeyPress(Sender: TObject; var Key: Char);
begin
// Caption:='Edit Access List - '+IntToStr(Ord(Key));
if Key=' ' then
begin
Key:=#0;
end;
end;
procedure TfrmEditAccessList.AdvStringGrid1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
// Caption:='Edit Access List - '+IntToStr(Key);
if Key=32 then Key:=0;
end;
Is there a way to fix this or a work around to prevent the keyboard behavior?
Thanks for reporting. We could trace & fix this issue.
Next update will address this.