New to Telerik UI for ASP.NET MVC? Start a free 30-day trial

Defines the fluent API for configuring the Kendo RadioGroup for ASP.NET MVC.

Definition

Constructors

Initializes a new instance of the RadioGroup class.

C#
public RadioGroupBuilder(RadioGroup component)
Parameters:componentRadioGroup

The component.

Methods

Array of items to be rendered as radio buttons in the RadioGroup. If the array contains objects, their fields will be used for each radio button. If the array contains strings, those will be used as both value and label of the respective radio button.

C#
public RadioGroupBuilder BindTo(IList<IInputGroupItem> values)
Parameters:valuesIList<IInputGroupItem>Returns:

RadioGroupBuilder

Example:
C#
@(Html.Kendo().RadioGroup()
.Name("radiogroup")
.BindTo(Model.Items)
)

Array of items to be rendered as radio buttons in the RadioGroup. The strings in the array will be used as both value and label of the respective radio button.

C#
public RadioGroupBuilder BindTo(string[] values)
Parameters:valuesstring[]Returns:

RadioGroupBuilder

Example:
C#
@(Html.Kendo().RadioGroup()
.Name("radiogroup")
.BindTo(new[] { "English", "German", "Italian" })
)

Sets the enabled state of all radio buttons in the RadioGroup.

C#
public RadioGroupBuilder Enabled(bool value)
Parameters:valuebool

The value that configures the enabled.

Returns:

RadioGroupBuilder

Example:
C#
@(Html.Kendo().RadioGroup()
.Name("radiogroup")
.Items(i =&gt;
{
i.Add().Label("Phone").Value("1");
i.Add().Label("E-mail").Value("2");
})
.Enabled(false)
)

Configures the client-side events.

C#
public RadioGroupBuilder Events(Action<RadioGroupEventBuilder> configurator)
Parameters:configuratorAction<RadioGroupEventBuilder>

The client events action.

Returns:

RadioGroupBuilder

Example:
C#
@( Html.Kendo().RadioGroup()
.Name("RadioGroup")
.Events(events =&gt; events
.Change("onChange")
)
)

The name attribute to be used for the radio inputs. If omitted, the id of the wrapper element will be used.

C#
public RadioGroupBuilder InputName(string value)
Parameters:valuestring

The value that configures the inputname.

Returns:

RadioGroupBuilder

Example:
C#
@(Html.Kendo().RadioGroup()
.Name("radiogroup")
.Items(i =&gt;
{
i.Add().Label("Phone").Value("1");
i.Add().Label("E-mail").Value("2");
})
.InputName("CommunicationOption")
)

Sets a value controlling the size of the input.

C#
public RadioGroupBuilder InputSize(ComponentSize value)
Parameters:valueComponentSize

The value that configures the inputsize.

Returns:

RadioGroupBuilder

Example:
C#
@(Html.Kendo().RadioGroup()
.Name("radiogroup")
.Items(i =&gt;
{
i.Add().Label("Phone").Value("1");
i.Add().Label("E-mail").Value("2");
})
.InputSize(ComponentSize.Large)
)

Array of items to be rendered as radio buttons in the RadioGroup. If the array contains objects, their fields will be used for each radio button. If the array contains strings, those will be used as both value and label of the respective radio button.

C#
public RadioGroupBuilder Items(Action<RadioGroupItemFactory> configurator)
Parameters:configuratorAction<RadioGroupItemFactory>

The action that configures the items.

Returns:

RadioGroupBuilder

Specifies the label position according to its radio button for all items in the widget. Accepts "before" and "after".

C#
public RadioGroupBuilder LabelPosition(RadioGroupLabelPosition value)
Parameters:valueRadioGroupLabelPosition

The value that configures the labelposition.

Returns:

RadioGroupBuilder

Example:
C#
@(Html.Kendo().RadioGroup()
.Name("radiogroup")
.Items(i =&gt;
{
i.Add().Label("Phone").Value("1");
i.Add().Label("E-mail").Value("2");
})
.LabelPosition(RadioGroupLabelPosition.Before)
)

Specifies the label position according to its radio button for all items in the widget. Accepts "before" and "after".

C#
public RadioGroupBuilder LabelPosition(string value)
Parameters:valuestring

The value that configures the labelposition.

Returns:

RadioGroupBuilder

Example:
C#
@(Html.Kendo().RadioGroup()
.Name("radiogroup")
.Items(i =&gt;
{
i.Add().Label("Phone").Value("1");
i.Add().Label("E-mail").Value("2");
})
.LabelPosition("before")
)

Specifies whether the radio buttons will be rendered one below the other ("vertical") or on the same line ("horizontal").

C#
public RadioGroupBuilder Layout(RadioGroupLayout value)
Parameters:valueRadioGroupLayout

The value that configures the layout.

Returns:

RadioGroupBuilder

Example:
C#
@(Html.Kendo().RadioGroup()
.Name("radiogroup")
.Items(i =&gt;
{
i.Add().Label("Phone").Value("1");
i.Add().Label("E-mail").Value("2");
})
.Layout(RadioGroupLayout.Vertical)
)

Specifies whether the radio buttons will be rendered one below the other ("vertical") or on the same line ("horizontal").

C#
public RadioGroupBuilder Layout(string value)
Parameters:valuestring

The value that configures the layout.

Returns:

RadioGroupBuilder

Example:
C#
@(Html.Kendo().RadioGroup()
.Name("radiogroup")
.Items(i =&gt;
{
i.Add().Label("Phone").Value("1");
i.Add().Label("E-mail").Value("2");
})
.Layout("vertical")
)

The selected (checked) radio button value. Will also be used as a RadioGroup component value.

C#
public RadioGroupBuilder Value(string value)
Parameters:valuestring

The value that configures the value.

Returns:

RadioGroupBuilder

Example:
C#
@(Html.Kendo().RadioGroup()
.Name("radiogroup")
.Items(i =&gt;
{
i.Add().Label("Phone").Value("1");
i.Add().Label("E-mail").Value("2");
})
.Value("2")
)