Class RadRadioButton
Represents a RadRadioButton control that enables the user to select a single option from a group of choices. Radio buttons are typically used in groups where only one option can be selected at a time.
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadRadioButton : RadToggleButton, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IPCHost, IAnalyticsProvider, ISupportRootUIAutomation
Constructors
RadRadioButton()
Initializes a new instance of the RadRadioButton class. Creates a radio button with default settings including automatic checking behavior and tab stop functionality.
Declaration
public RadRadioButton()
Properties
AutoCheck
Gets or sets a value indicating whether the IsChecked value and the appearance of the control automatically change when the control is clicked. When true and the radio button is part of a group, it automatically ensures that only one control is checked at a time. When false, a group of radio button controls will not act as a mutually exclusive group and the IsChecked property must be updated in code.
Declaration
public bool AutoCheck { get; set; }
Property Value
System.Boolean
|
AutoSize
Gets or sets a value indicating whether the control is automatically resized to display its entire contents. When enabled, the radio button will automatically adjust its size to accommodate its text and visual elements.
Declaration
public override bool AutoSize { get; set; }
Property Value
System.Boolean
|
Overrides
ButtonElement
Gets the RadRadioButtonElement that represents the visual element of this radio button control. This element contains the visual styling and behavior logic for the radio button including the check mark and text layout.
Declaration
public RadRadioButtonElement ButtonElement { get; }
Property Value
RadRadioButtonElement
|
DefaultSize
Gets the default size of the RadRadioButton control. This property returns the recommended dimensions for the radio button when no explicit size is set.
Declaration
protected override Size DefaultSize { get; }
Property Value
System.Drawing.Size
|
Overrides
RadioCheckAlignment
Gets or sets the alignment of the radio button's check mark relative to the text. This property determines where the radio button circle appears in relation to the button text.
Declaration
[RadPropertyDefaultValue("RadioCheckAlignment", typeof(RadRadioButtonElement))]
[RadDescription("RadioCheckAlignment", typeof(RadRadioButtonElement))]
public ContentAlignment RadioCheckAlignment { get; set; }
Property Value
System.Drawing.ContentAlignment
|
TabStop
Gets or sets a value indicating whether the user can give focus to this radio button using the TAB key. For radio buttons, this is automatically managed to ensure proper tab navigation within radio button groups. Only the checked radio button in a group typically receives tab focus.
Declaration
public bool TabStop { get; set; }
Property Value
System.Boolean
|
Methods
ButtonElement_ToggleStateChanged(Object, StateChangedEventArgs)
Handles the toggle state changed event from the button element and manages tab stop behavior for radio button groups. This method ensures proper keyboard navigation within radio button groups when the checked state changes.
Declaration
protected override void ButtonElement_ToggleStateChanged(object sender, StateChangedEventArgs args)
Parameters
System.Object
sender
The source of the event. |
StateChangedEventArgs
args
A StateChangedEventArgs that contains the event data. |
Overrides
CreateAccessibilityInstance()
Creates the accessibility instance for the radio button control to support assistive technologies. Returns a specialized accessibility object when accessibility objects are enabled.
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
System.Windows.Forms.AccessibleObject
An System.Windows.Forms.AccessibleObject that provides accessibility support for the radio button. |
Overrides
CreateButtonElement()
Creates the main button element that is specific for RadRadioButton. This method is responsible for instantiating the underlying visual element that provides the radio button functionality.
Declaration
protected override RadButtonElement CreateButtonElement()
Returns
RadButtonElement
A RadRadioButtonElement encapsulates the functionality of RadRadioButton. |
Overrides
CreateChildItems(RadElement)
Creates the child items and establishes event handlers for the radio button control. This method sets up the property change notification system for the button element.
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
RadElement
parent
The parent RadElement that will contain the child items. |
Overrides
InitializeUIAutomationProvider()
Initializes the UI Automation provider for the radio button control. This method creates and returns the automation provider that enables assistive technologies to interact with the radio button.
Declaration
protected override IRadRawElementProviderFragmentRoot InitializeUIAutomationProvider()
Returns
IRadRawElementProviderFragmentRoot
An IRadRawElementProviderFragmentRoot that provides UI Automation support for the radio button. |
Overrides
OnEnter(EventArgs)
Raises the System.Windows.Forms.Control.Enter event and handles keyboard navigation behavior for radio button groups. When entered via keyboard navigation, this method may automatically check the radio button or update tab stops.
Declaration
protected override void OnEnter(EventArgs e)
Parameters
System.EventArgs
e
An System.EventArgs that contains the event data. |
OnGotFocus(EventArgs)
Raises the System.Windows.Forms.Control.GotFocus event and invalidates the control to update its visual appearance. This method ensures the radio button displays the appropriate focus indicators when it receives focus.
Declaration
protected override void OnGotFocus(EventArgs e)
Parameters
System.EventArgs
e
An System.EventArgs that contains the event data. |
Overrides
res_CheckStateChanged(Object, EventArgs)
Raises the CheckStateChanged event when the check state of the radio button changes. This method provides notification when the radio button's checked state is modified.
Declaration
protected override void res_CheckStateChanged(object sender, EventArgs e)
Parameters
System.Object
sender
The source of the event. |
System.EventArgs
e
An System.EventArgs that contains the event data. |
Overrides
res_CheckStateChanging(Object, CheckStateChangingEventArgs)
Raises the CheckStateChanging event when the check state of the radio button is about to change. This method provides notification before the radio button's checked state is modified, allowing for cancellation.
Declaration
protected override void res_CheckStateChanging(object sender, CheckStateChangingEventArgs args)
Parameters
System.Object
sender
The source of the event. |
CheckStateChangingEventArgs
args
A CheckStateChangingEventArgs that contains the event data. |
Overrides
SetTabStops(Boolean)
Manages tab stop behavior for radio button groups to ensure proper keyboard navigation. This method coordinates tab stops among radio buttons in the same container to maintain standard Windows behavior.
Declaration
protected virtual void SetTabStops(bool tabPressed)
Parameters
System.Boolean
tabPressed
A value indicating whether this method was called as a result of tab key navigation. |