ClassRadItem
Represents an interactive element within the Telerik Presentation Framework that can respond to user input, participate in collections, and provide advanced UI behaviors such as selection, focus, and accessibility.
Definition
Namespace:Telerik.WinControls
Assembly:Telerik.WinControls.dll
Syntax:
[DefaultBindingProperty("Text")]
[ComVisible(true)]
public class RadItem : RadComponentElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItem
Derived Classes:
Implements:
Inherited Members
Constructors
Fields
ActionCommand
Declaration
public static readonly ClickCommand ActionCommand
Field Value
BorderHighlightColorProperty
Declaration
public static RadProperty BorderHighlightColorProperty
Field Value
BorderHighlightThicknessProperty
Declaration
public static RadProperty BorderHighlightThicknessProperty
Field Value
EnableBorderHighlightProperty
Declaration
public static RadProperty EnableBorderHighlightProperty
Field Value
EnableElementShadowProperty
Declaration
public static RadProperty EnableElementShadowProperty
Field Value
EnableFocusBorderAnimationProperty
Declaration
public static RadProperty EnableFocusBorderAnimationProperty
Field Value
EnableFocusBorderProperty
Declaration
public static RadProperty EnableFocusBorderProperty
Field Value
EnableHighlightProperty
Declaration
public static RadProperty EnableHighlightProperty
Field Value
EnableRippleAnimationProperty
Declaration
public static RadProperty EnableRippleAnimationProperty
Field Value
FocusBorderColorProperty
Declaration
public static RadProperty FocusBorderColorProperty
Field Value
FocusBorderWidthProperty
Declaration
public static RadProperty FocusBorderWidthProperty
Field Value
FocusCommand
Declaration
public static readonly FocusCommand FocusCommand
Field Value
HighlightColorProperty
Declaration
public static RadProperty HighlightColorProperty
Field Value
IsAddNewItemProperty
Declaration
public static RadProperty IsAddNewItemProperty
Field Value
RippleAnimationColorProperty
Declaration
public static RadProperty RippleAnimationColorProperty
Field Value
TextOrientationProperty
Declaration
public static RadProperty TextOrientationProperty
Field Value
UseDefaultDisabledPaintProperty
Declaration
public static RadProperty UseDefaultDisabledPaintProperty
Field Value
Properties
AccessibleDescription
Gets or sets the description that will be reported to accessibility client applications.
Declaration
public virtual string AccessibleDescription { get; set; }
Property Value
AccessibleName
Gets or sets the name of the control for use by accessibility client applications.
Declaration
public virtual string AccessibleName { get; set; }
Property Value
AccessibleRole
Gets or sets the accessible role of the item, which specifies the type of user interface element of the item.
Declaration
public virtual AccessibleRole AccessibleRole { get; set; }
Property Value
AllowDrag
Determines whether the element may be dragged by a RadDragDropService instance.
Declaration
[Browsable(false)]
public bool AllowDrag { get; set; }
Property Value
Implements
AllowDrop
Determines whether the element may accept a drop operation.
Declaration
[Browsable(false)]
public bool AllowDrop { get; set; }
Property Value
Implements
CanHaveOwnStyle
Gets a value indicating whether the element can have its own style with style conditions.
Declaration
public override bool CanHaveOwnStyle { get; }
Property Value
Overrides
DefaultAutoToolTip
Gets the default value for the AutoToolTip property.
Declaration
protected virtual bool DefaultAutoToolTip { get; }
Property Value
The default auto tooltip behavior for this item type.
EnableFocusBorderAnimation
Declaration
public bool EnableFocusBorderAnimation { get; set; }
Property Value
FlipText
Specifies the text associated with this item will be flipped.
Declaration
[Browsable(true)]
public virtual bool FlipText { get; set; }
Property Value
KeyTip
Gets or sets the key tip text for this item used for keyboard navigation.
ParentItem
Gets the parent RadItem of this item, if any.
Selectable
Gets or sets a value indicating whether the item can be selected.
Declaration
[Browsable(false)]
public virtual bool Selectable { get; }
Property Value
Shortcuts
Gets the collection of all RadShortcut instances registered with this item.
Declaration
[Browsable(false)]
public RadShortcutCollection Shortcuts { get; }
Property Value
Implements
ShortcutsHandler
Gets the shortcuts handler for managing keyboard shortcuts.
Declaration
protected virtual IComponentTreeHandler ShortcutsHandler { get; }
Property Value
ShouldHandleMouseInput
Gets or sets a value indicating whether the item should handle mouse input events.
Declaration
public override bool ShouldHandleMouseInput { get; set; }
Property Value
Overrides
StateManager
Declaration
public virtual ItemStateManagerBase StateManager { get; set; }
Property Value
ItemStateManagerBase
Implements
Text
Gets or sets the text displayed by this item.
Declaration
[Bindable(true)]
[SettingsBindable(true)]
public virtual string Text { get; set; }
Property Value
The text content of the item. The default value is an empty string.
Remarks
This property supports data binding and localization. The text can contain HTML markup when the HTML support is enabled for the containing control. Changes to this property will trigger layout updates and repainting of the item.
TextOrientation
Specifies the orientation of the text associated with this item. Whether it should appear horizontal or vertical.
Declaration
[Browsable(true)]
public virtual Orientation TextOrientation { get; set; }
Property Value
ThemeRole
Declaration
[Browsable(false)]
public string ThemeRole { get; set; }
Property Value
ToolTipText
Declaration
public override string ToolTipText { get; set; }
Property Value
Overrides
UseDefaultDisabledPaint
Gets or sets whether the item should use the default way for painting the item when disabled (making it gray) or whether the disabled appearance should be controlled by the theme.
Declaration
[Browsable(true)]
public bool UseDefaultDisabledPaint { get; set; }
Property Value
VisualState
Gets or sets string representing the current visual state of the Item which is used by themes to determine the appearance of the item and its child elements
Declaration
[Browsable(true)]
public string VisualState { get; set; }
Property Value
Methods
CallOnGesture(GestureEventArgs)
Calls the OnGesture(GestureEventArgs) method for handling gesture input.
Declaration
protected void CallOnGesture(GestureEventArgs args)
Parameters
args
The gesture event arguments.
CanDragCore(Point)
Determines whether the element may be dragged.
CanHandleShortcut(ShortcutEventArgs)
Declaration
protected virtual bool CanHandleShortcut(ShortcutEventArgs e)
Parameters
e
Returns
ContainsText()
Determines if the item displays any text.
Declaration
protected virtual bool ContainsText()
Returns
True if the item contains text; otherwise, false.
Deselect()
Deselects this item if it is selectable.
Declaration
public void Deselect()
DisposeManagedResources()
Releases managed resources used by this element.
Declaration
protected override void DisposeManagedResources()
Overrides
DoKeyDown(KeyEventArgs)
Handles the KeyDown event for this item.
Declaration
protected virtual void DoKeyDown(KeyEventArgs e)
Parameters
e
The key event arguments.
DoKeyPress(KeyPressEventArgs)
Handles the KeyPress event for this item.
Declaration
protected virtual void DoKeyPress(KeyPressEventArgs e)
Parameters
e
The key press event arguments.
DoKeyUp(KeyEventArgs)
Handles the KeyUp event for this item.
Declaration
protected virtual void DoKeyUp(KeyEventArgs e)
Parameters
e
The key event arguments.
GetAvailableVisualStates()
Gets the available visual states for this item. Visual states can be combined using "." (dot).
Declaration
public List<string> GetAvailableVisualStates()
Returns
List<string>
A list with the available visual states for this element.
GetDragContextCore()
Gets the context, associated with a drag operation.
Declaration
protected virtual object GetDragContextCore()
Returns
The drag context object.
GetDragHintCore()
Gets the image to be used as a hint when this element is being dragged.
Declaration
protected virtual Image GetDragHintCore()
Returns
An image representing the drag hint for this element.
InitializeFields()
Initializes the fields of this instance with their default values.
Declaration
protected override void InitializeFields()
Overrides
OnDeselect()
Called when the item is deselected. Notifies the parent control to clear the selected item.
Declaration
protected virtual void OnDeselect()
OnEnabledChanged(RadPropertyChangedEventArgs)
Called when the Enabled property changes, applying special handling for disabled state.
Declaration
protected override void OnEnabledChanged(RadPropertyChangedEventArgs e)
Parameters
e
The property changed event arguments.
Overrides
OnFlipTextChanged(EventArgs)
Raises the FlipTextChanged event.
OnGesture(GestureEventArgs)
Calls the appropriate gesture event according to the GestureType property of the event arguments.
Declaration
protected virtual void OnGesture(GestureEventArgs args)
Parameters
args
The event arguments.
OnKeyDown(KeyEventArgs)
Raises the KeyDown event.
Declaration
protected virtual void OnKeyDown(KeyEventArgs e)
Parameters
e
The key event arguments.
OnKeyPress(KeyPressEventArgs)
Raises the KeyPress event.
Declaration
protected virtual void OnKeyPress(KeyPressEventArgs e)
Parameters
e
The key press event arguments.
OnKeyUp(KeyEventArgs)
Raises the KeyUp event.
Declaration
protected virtual void OnKeyUp(KeyEventArgs e)
Parameters
e
The key event arguments.
OnMouseDown(MouseEventArgs)
Called when a mouse button is pressed down over the item.
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
e
The mouse event arguments.
Overrides
OnMouseLeave(EventArgs)
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
e
Overrides
OnMouseMove(MouseEventArgs)
Called when the mouse moves over the item, handling highlight and border highlight effects.
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
e
The mouse event arguments.
Overrides
OnMouseUp(MouseEventArgs)
Called when a mouse button is released over the item.
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
e
The mouse event arguments.
Overrides
OnPanGesture(PanGestureEventArgs)
Fires the PanGesture event.
Declaration
protected virtual void OnPanGesture(PanGestureEventArgs args)
Parameters
args
The arguments for the PanGesture event.
OnPressAndTapGesture(PressAndTapGestureEventArgs)
Fires the PressAndTapGesture event.
Declaration
protected virtual void OnPressAndTapGesture(PressAndTapGestureEventArgs args)
Parameters
args
The arguments for the PressAndTapGesture event.
OnPropertyChanged(RadPropertyChangedEventArgs)
Called when a property value has changed, handling item-specific property change logic including text, visual state, and animation properties.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
e
The property changed event arguments.
Overrides
OnPropertyChanging(RadPropertyChangingEventArgs)
Called before a property value is changed, allowing for validation or cancellation of text changes.
Declaration
protected override void OnPropertyChanging(RadPropertyChangingEventArgs args)
Parameters
args
The property changing event arguments.
Overrides
OnRotateGesture(RotateGestureEventArgs)
Fires the RotateGesture event.
Declaration
protected virtual void OnRotateGesture(RotateGestureEventArgs args)
Parameters
args
The arguments for the RotateGesture event.
OnSelect()
Called when the item is selected. Notifies the parent control to update the selected item.
Declaration
protected virtual void OnSelect()
OnTextChanged(EventArgs)
Raises the TextChanged event.
OnTextChanging(TextChangingEventArgs)
Raises the TextChanging event.
Declaration
protected virtual void OnTextChanging(TextChangingEventArgs e)
Parameters
e
A TextChangingEventArgs that contains the event data.
OnTextOrientationChanged(EventArgs)
Raises the TextOrientationChanged event.
OnTwoFingerTapGesture(GestureEventArgs)
Fires the TwoFingerTapGesture event.
Declaration
protected virtual void OnTwoFingerTapGesture(GestureEventArgs args)
Parameters
args
The arguments for the TwoFingerTapGesture event.
OnZoomGesture(ZoomGestureEventArgs)
Fires the ZoomGesture event.
Declaration
protected virtual void OnZoomGesture(ZoomGestureEventArgs args)
Parameters
args
The arguments for the ZoomGesture event.
PaintOverride(IGraphics, Rectangle, float, SizeF, bool)
Paints the item, handling disabled state rendering with special grayscale treatment when UseDefaultDisabledPaint is true.
Declaration
protected override void PaintOverride(IGraphics screenRadGraphics, Rectangle clipRectangle, float angle, SizeF scale, bool useRelativeTransformation)
Parameters
screenRadGraphics
The graphics object to paint on.
clipRectangle
The clipping rectangle for painting.
angle
The rotation angle to apply.
scale
The scale factor to apply.
useRelativeTransformation
Whether to use relative transformation.
Overrides
ProcessDragDrop(Point, ISupportDrag)
Core logic when a drag-drop is performed over this element. Allows inheritors to provide their own implementations.
Declaration
protected virtual void ProcessDragDrop(Point dropLocation, ISupportDrag dragObject)
Parameters
dropLocation
The location where the drop occurred.
dragObject
The object being dragged.
ProcessDragEnter(Point, ISupportDrag)
Allows the element to perform additional action upon mouse entering its bounds upon a drag-and-drop operation.
Declaration
protected virtual void ProcessDragEnter(Point mousePosition, ISupportDrag dragObject)
Parameters
mousePosition
The current mouse position.
dragObject
The object being dragged.
ProcessDragLeave(Point, ISupportDrag)
Allows the element to perform additional action upon mouse leaving its bounds upon a drag-and-drop operation.
Declaration
protected virtual void ProcessDragLeave(Point oldMousePosition, ISupportDrag dragObject)
Parameters
oldMousePosition
The previous mouse position.
dragObject
The object being dragged.
ProcessDragOver(Point, ISupportDrag)
Determines whether the element may be treated as a drop target during drag-and-drop operation.
Declaration
protected virtual bool ProcessDragOver(Point mousePosition, ISupportDrag dragObject)
Parameters
mousePosition
The current mouse position.
dragObject
The object being dragged.
Returns
True if the element can accept the drop; otherwise, false.
RaiseBubbleEvent(RadElement, RoutedEventArgs)
Raises routed events in the bubble phase, handling key events specifically.
Declaration
public override void RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
Parameters
sender
The element that raised the event.
args
The routed event arguments.
Overrides
RaiseKeyDown(KeyEventArgs)
Declaration
protected virtual void RaiseKeyDown(KeyEventArgs e)
Parameters
e
RaiseKeyPress(KeyPressEventArgs)
Declaration
protected virtual void RaiseKeyPress(KeyPressEventArgs e)
Parameters
e
RaiseKeyUp(KeyEventArgs)
Declaration
protected virtual void RaiseKeyUp(KeyEventArgs e)
Parameters
e
ReplaceDefaultDescriptors(PropertyDescriptorCollection)
Add the VisualState property if we are in the context of RadControlSpy.
Declaration
protected override PropertyDescriptorCollection ReplaceDefaultDescriptors(PropertyDescriptorCollection props)
Parameters
props
Returns
Overrides
ResetThemeValueOverride(RadProperty)
Resets all overrides for the theme settings of a given property.
Declaration
public void ResetThemeValueOverride(RadProperty property)
Parameters
property
The property to reset overrides for.
ResetThemeValueOverride(RadProperty, string)
Resets all overrides for the theme settings of a given property and a given state.
Declaration
public void ResetThemeValueOverride(RadProperty property, string state)
Parameters
property
The property to reset overrides for.
state
The state to reset.
ResetThemeValueOverrides()
Resets all theme override settings for this element.
Declaration
public void ResetThemeValueOverrides()
Select()
Selects this item if it is selectable.
Declaration
public bool Select()
Returns
True if the item was successfully selected; otherwise, false.
SetOwnerCollection(RadItemOwnerCollection)
Sets the owner collection for this item.
Declaration
protected virtual void SetOwnerCollection(RadItemOwnerCollection ownerCollection)
Parameters
ownerCollection
The collection that owns this item.
SetThemeValueOverride(RadProperty, object, string)
Applies the provided value as an override of the theme setting for the specified property in the specified state.
Declaration
public void SetThemeValueOverride(RadProperty property, object value, string state)
Parameters
property
The property to override.
value
The value to override the theme setting with.
state
The VisualState of the item for which the setting will be applied. States can be combined using "." (dot). To see a list of the available states for this element, use the GetAvailableVisualStates method.
SetThemeValueOverride(RadProperty, object, string, Type)
Applies the provided value as an override of the theme setting for the specified property in the specified state.
Declaration
public void SetThemeValueOverride(RadProperty property, object value, string state, Type childElementType)
Parameters
property
The property to override.
value
The value to override the theme setting with.
state
The VisualState of the item for which the setting will be applied. States can be combined using "." (dot). To see a list of the available states for this element, use the GetAvailableVisualStates method.
childElementType
The type of the child element for which the override stands. (e.g. typeof(FillPrimitive), typeof(BorderPrimitive), etc.)
SetThemeValueOverride(RadProperty, object, string, string)
Applies the provided value as an override of the theme setting for the specified property in the specified state.
Declaration
public void SetThemeValueOverride(RadProperty property, object value, string state, string childElementClass)
Parameters
property
The property to override.
value
The value to override the theme setting with.
state
The VisualState of the item for which the setting will be applied. States can be combined using "." (dot). To see a list of the available states for this element, use the GetAvailableVisualStates method.
childElementClass
The value of the Class property of the child element for which the override stands. (e.g. ButtonFill, ButtonBorder, etc.)
ShouldSerializeProperty(PropertyDescriptor)
Determines whether the property defined by the provided property descriptor should be serialized.
Declaration
public override bool? ShouldSerializeProperty(PropertyDescriptor property)
Parameters
property
Returns
bool?
Overrides
StartRippleAnimation(MouseEventArgs)
Declaration
protected virtual void StartRippleAnimation(MouseEventArgs e)
Parameters
e
UpdateFocusBorder(bool)
Declaration
protected virtual void UpdateFocusBorder(bool isFocused)
Parameters
isFocused
UpdateOnShortcutsChanged()
Declaration
protected virtual void UpdateOnShortcutsChanged()
Events
FlipTextChanged
Occurs when the FlipText property value changes.
KeyDown
Occurs when the RadItem has focus and the user presses a key down.
KeyPress
Occurs when the RadItem has focus and the user presses a key.
Declaration
public event KeyPressEventHandler KeyPress
Event Value
KeyUp
Occurs when the RadItem has focus and the user releases the pressed key up.
PanGesture
Occurs when a pan gesture was sent by a touch input device.
Declaration
[Browsable(true)]
public event PanGestureEventHandler PanGesture
Event Value
PressAndTapGesture
Occurs when a press-and-tap gesture was sent by a touch input device.
Declaration
[Browsable(true)]
public event PressAndTapGestureEventHandler PressAndTapGesture
Event Value
QueryAccessibilityHelp
Occurs when help is requested for an accessibility object.
Declaration
public event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp
Event Value
RotateGesture
Occurs when a rotate gesture was sent by a touch input device.
Declaration
[Browsable(true)]
public event RotateGestureEventHandler RotateGesture
Event Value
TextChanged
Occurs when the Text property value changes.
TextChanging
Occurs when the Text property value is about to be changed.
Declaration
public event TextChangingEventHandler TextChanging
Event Value
TextOrientationChanged
Occurs when the TextOrientation property value changes.
Declaration
public event EventHandler TextOrientationChanged
Event Value
TwoFingerTapGesture
Occurs when a two-finger-tap gesture was sent by a touch input device.
Declaration
[Browsable(true)]
public event GestureEventHandler TwoFingerTapGesture
Event Value
ZoomGesture
Occurs when a zoom gesture was sent by a touch input device.
Declaration
[Browsable(true)]
public event ZoomGestureEventHandler ZoomGesture
Event Value