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

Defines the fluent API for configuring the Kendo UI RadioGroup

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class RadioGroupBuilder : WidgetBuilderBase<RadioGroup, RadioGroupBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<RadioGroup, RadioGroupBuilder>RadioGroupBuilder

Implements: IHtmlContent

Inherited Members WidgetBuilderBase<RadioGroup, RadioGroupBuilder>.ToComponent()WidgetBuilderBase<RadioGroup, RadioGroupBuilder>.Expression(string)WidgetBuilderBase<RadioGroup, RadioGroupBuilder>.Explorer(ModelExplorer)WidgetBuilderBase<RadioGroup, RadioGroupBuilder>.Name(string)WidgetBuilderBase<RadioGroup, RadioGroupBuilder>.Deferred(bool)WidgetBuilderBase<RadioGroup, RadioGroupBuilder>.HtmlAttributes(object)WidgetBuilderBase<RadioGroup, RadioGroupBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<RadioGroup, RadioGroupBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<RadioGroup, RadioGroupBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<RadioGroup, RadioGroupBuilder>.Render()WidgetBuilderBase<RadioGroup, RadioGroupBuilder>.ToHtmlString()WidgetBuilderBase<RadioGroup, RadioGroupBuilder>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<RadioGroup, RadioGroupBuilder>.ToClientTemplate()WidgetBuilderBase<RadioGroup, RadioGroupBuilder>.AsModule(bool)WidgetBuilderBase<RadioGroup, RadioGroupBuilder>.ComponentWidgetBuilderBase<RadioGroup, RadioGroupBuilder>.ContainerHelperResult.WriteTo(TextWriter, HtmlEncoder)HelperResult.WriteActionobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the RadioGroupBuilder class.

C#
public RadioGroupBuilder(RadioGroup component)
Parameters:componentRadioGroup

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(IEnumerable<IInputGroupItem> values)
Parameters:valuesIEnumerable<IInputGroupItem>

The action that configures the items.

Returns:

RadioGroupBuilder

Returns the current RadioGroupBuilder instance.

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[]

The action that configures the items.

Returns:

RadioGroupBuilder

Returns the current RadioGroupBuilder instance.

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 for Enabled

Returns:

RadioGroupBuilder

Returns the current RadioGroupBuilder instance.

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

Returns the current RadioGroupBuilder instance.

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 for InputName

Returns:

RadioGroupBuilder

Returns the current RadioGroupBuilder instance.

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 for InputSize

Returns:

RadioGroupBuilder

Returns the current RadioGroupBuilder instance.

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 RadioGroupItemFactory for the items setting.

Returns:

RadioGroupBuilder

Returns the current instance of 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 for LabelPosition

Returns:

RadioGroupBuilder

Returns the current RadioGroupBuilder instance.

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 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

Returns the current RadioGroupBuilder instance.

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 for Layout

Returns:

RadioGroupBuilder

Returns the current RadioGroupBuilder instance.

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")
)

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

Returns the current RadioGroupBuilder instance.

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 widget value.

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

The value for Value

Returns:

RadioGroupBuilder

Returns the current RadioGroupBuilder instance.

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")
)