Represents a toggle button element. The toggle button supports two or three states depending on the IsThreeState property.
The RadToggleButton class is a simple wrapper for the RadToggleButtonElement class. All UI and logic functionality is implemented in the RadToggleButtonElement class. The RadToggleButton acts to transfer events to and from its corresponding RadToggleButtonElement instance. The latter can be nested in other telerik controls.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class RadToggleButtonElement : RadButtonElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IButtonControl, IImageElement
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemRadButtonItemRadButtonElementRadToggleButtonElement...
Derived Classes:
Implements:
Inherited Members
Constructors
public RadToggleButtonElement()
Fields
Identifies the Checked routed event.
public static RoutedEvent CheckedRoutedEvent
Identifies the Indeterminate routed event.
public static RoutedEvent Indeterminate
Identifies the ToggleStateChanging routed event.
public static RoutedEvent ToggleStateChangingRoutedEvent
Identifies the ToggleState dependency property.
public static RadProperty ToggleStateProperty
Identifies the Unchecked routed event.
public static RoutedEvent Unchecked
Properties
Gets or sets the check state of the toggle button using CheckState enumeration. CheckState enumeration defines the following values: Unchecked, Checked, and Indeterminate.
[Browsable(true)]
[Bindable(true)]
public CheckState CheckState { get; set; }
Gets or sets a value indicating whether the button is checked. Returns true if the toggle state is not Off; otherwise, false.
[Browsable(false)]
[Bindable(true)]
public bool IsChecked { get; set; }
Gets or sets a value indicating whether the toggle button has three or two states. When true, the button supports Checked, Unchecked, and Indeterminate states.
[Browsable(true)]
[Bindable(true)]
public bool IsThreeState { get; set; }
Gets or sets a value indicating whether the toggle button element is read only. When read-only, the button cannot be toggled by user interaction but can still be changed programmatically.
[Browsable(true)]
public bool ReadOnly { get; set; }
true if the toggle button element is read only; otherwise, false.
Gets or sets the toggle state of the button using ToggleState enumeration. Toggle state enumeration defines the following values: Off, Indeterminate, and On.
[Browsable(true)]
[Bindable(true)]
public ToggleState ToggleState { get; set; }
Methods
Creates the child elements of the toggle button.
protected override void CreateChildElements()
Overrides:
Gets the visual style element for Windows XP theme rendering based on the current state of the toggle button.
public override VisualStyleElement GetXPVisualStyle()
The VisualStyleElement corresponding to the current state of the toggle button.
Overrides:
Raises the CheckStateChanging event.
protected virtual void OnCheckStateChanging(CheckStateChangingEventArgs e)
A CheckStateChangingEventArgs that contains the event data.
Performs the toggle operation by changing the toggle state based on the current state and whether three-state mode is enabled.
protected virtual void OnToggle()
Raises the StateChanged event.
protected virtual void OnToggleStateChanged(StateChangedEventArgs e)
A StateChangedEventArgs that contains the event data.
Raises the StateChanging event and checks if the indeterminate state is allowed.
protected virtual void OnToggleStateChanging(StateChangingEventArgs e)
A StateChangingEventArgs that contains the event data.
Sets the toggle state of the button by calling the core implementation.
protected virtual void SetToggleState(ToggleState value)
The new toggle state value to set.
Events
Occurs when the elements's check state changes.
[Browsable(true)]
public event EventHandler CheckStateChanged
Occurs before the elements's check state changes.
[Browsable(true)]
public event CheckStateChangingEventHandler CheckStateChanging
Occurs when the elements's state changes.
[Browsable(true)]
public event StateChangedEventHandler ToggleStateChanged
Occurs before the elements's state changes.
[Browsable(true)]
public event StateChangingEventHandler ToggleStateChanging