dormky 2 Posted February 7 (edited) I have a TDBRadioGroup with 2 options. Unfortunately, when pressing TAB to go from field to field, when it gets to the TDBRadioGroup you can't edit the values via keyboard. I tried space, enter and arrows, all with shift and ctrl. What's the deal here ? Is there no way to actually give the focus to this type of field and edit it via keyboard ? The TabOrder is correct and TabStop is True. Strangely enough, once you've clicked on an option it suddenly becomes available in the TAB navigation, and at the expected order. Not sure what's happening here, is it because there is no default value (none of the options are selected at first) ? Edited February 7 by dormky Share this post Link to post
PeterBelow 238 Posted February 8 21 hours ago, dormky said: I have a TDBRadioGroup with 2 options. Unfortunately, when pressing TAB to go from field to field, when it gets to the TDBRadioGroup you can't edit the values via keyboard. I tried space, enter and arrows, all with shift and ctrl. What's the deal here ? Is there no way to actually give the focus to this type of field and edit it via keyboard ? The TabOrder is correct and TabStop is True. Strangely enough, once you've clicked on an option it suddenly becomes available in the TAB navigation, and at the expected order. Not sure what's happening here, is it because there is no default value (none of the options are selected at first) ? A radio group, by its very nature, must have one of the options checked. If you need to indicate that none of your two options applies then that has to be added as a third option that is checked as default. What type of database field have you tied the group to? Share this post Link to post
dormky 2 Posted February 9 19 hours ago, PeterBelow said: A radio group, by its very nature, must have one of the options checked. If you need to indicate that none of your two options applies then that has to be added as a third option that is checked as default. What type of database field have you tied the group to? It's a VARCHAR(1), for the sex. The default value is empty, so none of the values are checked, which makes sense. Share this post Link to post
Pat Foley 51 Posted February 9 Try setting the TabStop property of Radiogroup to True when none of the controls are selected. In the RadioGroups.OnEnter set focus on a control so keys can change the selection as needed. //Need RG .TabStop prop set to True to 'focus' the groupbox when its control index //is -1; procedure TformInstructorStation.RadioGroup2Enter(Sender: TObject); begin with Sender as TRadioGroup do if ItemIndex = -1 then TRadioButton(Controls[0]).SetFocus; //(Sender as TRadioGroup).OnEnter := nil; end; Share this post Link to post