Coxy
Coxy

Reputation: 8928

DevExpress - how should I lay out a radio button group that has associated controls?

This is a problem I've faced a couple of times now and never really been satisfied with how it's turned out. We use DevExpress GUI toolkit in our app which has a RadioGroup control that seems rather inflexible. Usually when we find ourselves wanting to use radio buttons, there are user inputs associated with the radio button choice. What we usually do is something like this:

enter image description here

So this has several obvious problems with it:

  1. The spacing of the RadioGroupItems in the RadioGroup cannot be controlled directly. They evenly space themselves to the height of the RadioGroup control.
  2. The items in the list don't align with any other controls.
  3. The programmer must manually enable and disable controls based on the value of the RadioGroup.
  4. Otherwise-usable space in the form is wasted, especially since width happens to be at a premium in our UI.
  5. There is no user-visible grouping of items apart from vague physical proximity. This is particularly bad if one of the text labels on the RadioGroupItems is much longer than the other.

So, is there anything within DevExpress that we should be using instead?
Failing that, is there any way to put singular RadioGroupItems into the form and position them myself?

Upvotes: 1

Views: 2253

Answers (1)

nempoBu4
nempoBu4

Reputation: 6621

You can use several CheckEdit controls. Set the CheckEdit.Properties.RadioGroupIndex property of each CheckEdit to the same value and set CheckEdit.Properties.CheckStyle to CheckStyles.Radio value.

  1. The spacing is controlled directly.
  2. The CheckEdit control aligns with any other controls.
  3. You can add bindings for CheckEdit.EditValue property to enable and disable controls.
  4. You can manipulate with the usable space.
  5. The text of each CheckEdit control can be controlled independently.

Screenshot

Upvotes: 1

Related Questions