RadItem
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
public static readonly ClickCommand ActionCommand
public static RadProperty BorderHighlightColorProperty
public static RadProperty BorderHighlightThicknessProperty
public static RadProperty EnableBorderHighlightProperty
public static RadProperty EnableElementShadowProperty
public static RadProperty EnableFocusBorderAnimationProperty
public static RadProperty EnableFocusBorderProperty
public static RadProperty EnableHighlightProperty
public static RadProperty EnableRippleAnimationProperty
public static RadProperty FlipTextProperty
public static RadProperty FocusBorderColorProperty
public static RadProperty FocusBorderWidthProperty
public static readonly FocusCommand FocusCommand
public static RadProperty HighlightColorProperty
public static RadProperty IsAddNewItemProperty
protected bool IsPaintingRipple
public static RoutedEvent KeyDownEvent
public static RoutedEvent KeyPressEvent
public static RoutedEvent KeyUpEvent
public static RadProperty RippleAnimationColorProperty
public static RadProperty ShadowColorProperty
public static RadProperty ShadowDepthProperty
public static RadProperty TextOrientationProperty
public static RadProperty TextProperty
public static RadProperty ToolTipTextProperty
public static RadProperty UseDefaultDisabledPaintProperty
public static RadProperty VisualStateProperty
Properties
Gets or sets the description that will be reported to accessibility client applications.
public virtual string AccessibleDescription { get; set; }
Gets or sets the name of the control for use by accessibility client applications.
public virtual string AccessibleName { get; set; }
Gets or sets the accessible role of the item, which specifies the type of user interface element of the item.
public virtual AccessibleRole AccessibleRole { get; set; }
Determines whether the element may be dragged by a RadDragDropService instance.
[Browsable(false)]
public bool AllowDrag { get; set; }
Implements:
Determines whether the element may accept a drop operation.
[Browsable(false)]
public bool AllowDrop { get; set; }
Implements:
public Color BorderHighlightColor { get; set; }
public int BorderHighlightThickness { get; set; }
Gets a value indicating whether the element can have its own style with style conditions.
public override bool CanHaveOwnStyle { get; }
Overrides:
Gets the default value for the AutoToolTip property.
protected virtual bool DefaultAutoToolTip { get; }
The default auto tooltip behavior for this item type.
public bool EnableBorderHighlight { get; set; }
public bool EnableElementShadow { get; set; }
public bool EnableFocusBorder { get; set; }
public bool EnableFocusBorderAnimation { get; set; }
public bool EnableHighlight { get; set; }
public bool EnableRippleAnimation { get; set; }
Specifies the text associated with this item will be flipped.
[Browsable(true)]
public virtual bool FlipText { get; set; }
public Color FocusBorderColor { get; set; }
public int FocusBorderWidth { get; set; }
public Color HighlightColor { get; set; }
Gets or sets the key tip text for this item used for keyboard navigation.
public virtual string KeyTip { get; set; }
protected virtual string MnemonicText { get; }
Gets the parent RadItem of this item, if any.
protected RadItem ParentItem { get; }
public Color RippleAnimationColor { get; set; }
Gets or sets a value indicating whether the item can be selected.
[Browsable(false)]
public virtual bool Selectable { get; }
public Color ShadowColor { get; set; }
public int ShadowDepth { get; set; }
Gets the collection of all RadShortcut instances registered with this item.
[Browsable(false)]
public RadShortcutCollection Shortcuts { get; }
Implements:
Gets the shortcuts handler for managing keyboard shortcuts.
protected virtual IComponentTreeHandler ShortcutsHandler { get; }
Gets or sets a value indicating whether the item should handle mouse input events.
public override bool ShouldHandleMouseInput { get; set; }
Overrides:
StateManager
ItemStateManagerBase
public virtual ItemStateManagerBase StateManager { get; set; }
Implements:
Gets or sets the text displayed by this item.
[Bindable(true)]
[SettingsBindable(true)]
public virtual string Text { get; set; }
The text content of the item. The default value is an empty string.
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.
Specifies the orientation of the text associated with this item. Whether it should appear horizontal or vertical.
[Browsable(true)]
public virtual Orientation TextOrientation { get; set; }
public override string ToolTipText { get; set; }
Overrides:
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.
[Browsable(true)]
public bool UseDefaultDisabledPaint { get; set; }
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
[Browsable(true)]
public string VisualState { get; set; }
Methods
Calls the OnGesture(GestureEventArgs) method for handling gesture input.
protected void CallOnGesture(GestureEventArgs args)
The gesture event arguments.
protected virtual bool CanHandleShortcut(ShortcutEventArgs e)
Determines if the item displays any text.
protected virtual bool ContainsText()
True if the item contains text; otherwise, false.
Deselects this item if it is selectable.
public void Deselect()
Releases managed resources used by this element.
protected override void DisposeManagedResources()
Overrides:
Handles the KeyDown event for this item.
protected virtual void DoKeyDown(KeyEventArgs e)
The key event arguments.
Handles the KeyPress event for this item.
protected virtual void DoKeyPress(KeyPressEventArgs e)
The key press event arguments.
Handles the KeyUp event for this item.
Gets the available visual states for this item. Visual states can be combined using "." (dot).
public List<string> GetAvailableVisualStates()
List<string>
A list with the available visual states for this element.
Gets the context, associated with a drag operation.
Gets the image to be used as a hint when this element is being dragged.
protected virtual Image GetDragHintCore()
An image representing the drag hint for this element.
Initializes the fields of this instance with their default values.
protected override void InitializeFields()
Overrides:
Called when the item is deselected. Notifies the parent control to clear the selected item.
protected virtual void OnDeselect()
Called when the Enabled property changes, applying special handling for disabled state.
protected override void OnEnabledChanged(RadPropertyChangedEventArgs e)
The property changed event arguments.
Overrides:
Raises the FlipTextChanged event.
Calls the appropriate gesture event according to the GestureType property of the event arguments.
protected virtual void OnGesture(GestureEventArgs args)
The event arguments.
Raises the KeyDown event.
protected virtual void OnKeyDown(KeyEventArgs e)
The key event arguments.
Raises the KeyPress event.
protected virtual void OnKeyPress(KeyPressEventArgs e)
The key press event arguments.
Raises the KeyUp event.
Called when a mouse button is pressed down over the item.
protected override void OnMouseDown(MouseEventArgs e)
The mouse event arguments.
Overrides:
Called when the mouse moves over the item, handling highlight and border highlight effects.
protected override void OnMouseMove(MouseEventArgs e)
The mouse event arguments.
Overrides:
Called when a mouse button is released over the item.
protected override void OnMouseUp(MouseEventArgs e)
The mouse event arguments.
Overrides:
Fires the PanGesture event.
protected virtual void OnPanGesture(PanGestureEventArgs args)
The arguments for the PanGesture event.
Fires the PressAndTapGesture event.
protected virtual void OnPressAndTapGesture(PressAndTapGestureEventArgs args)
The arguments for the PressAndTapGesture event.
Called when a property value has changed, handling item-specific property change logic including text, visual state, and animation properties.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
The property changed event arguments.
Overrides:
Called before a property value is changed, allowing for validation or cancellation of text changes.
protected override void OnPropertyChanging(RadPropertyChangingEventArgs args)
The property changing event arguments.
Overrides:
Fires the RotateGesture event.
protected virtual void OnRotateGesture(RotateGestureEventArgs args)
The arguments for the RotateGesture event.
Called when the item is selected. Notifies the parent control to update the selected item.
protected virtual void OnSelect()
Raises the TextChanged event.
Raises the TextChanging event.
protected virtual void OnTextChanging(TextChangingEventArgs e)
A TextChangingEventArgs that contains the event data.
Raises the TextOrientationChanged event.
Fires the TwoFingerTapGesture event.
protected virtual void OnTwoFingerTapGesture(GestureEventArgs args)
The arguments for the TwoFingerTapGesture event.
Fires the ZoomGesture event.
protected virtual void OnZoomGesture(ZoomGestureEventArgs args)
The arguments for the ZoomGesture event.
Paints the item, handling disabled state rendering with special grayscale treatment when UseDefaultDisabledPaint is true.
protected override void PaintOverride(IGraphics screenRadGraphics, Rectangle clipRectangle, float angle, SizeF scale, bool useRelativeTransformation)
The graphics object to paint on.
clipRectangleRectangleThe clipping rectangle for painting.
anglefloatThe rotation angle to apply.
scaleSizeFThe scale factor to apply.
useRelativeTransformationboolWhether to use relative transformation.
Overrides:
Core logic when a drag-drop is performed over this element. Allows inheritors to provide their own implementations.
protected virtual void ProcessDragDrop(Point dropLocation, ISupportDrag dragObject)
The location where the drop occurred.
dragObjectISupportDragThe object being dragged.
Allows the element to perform additional action upon mouse entering its bounds upon a drag-and-drop operation.
protected virtual void ProcessDragEnter(Point mousePosition, ISupportDrag dragObject)
The current mouse position.
dragObjectISupportDragThe object being dragged.
Allows the element to perform additional action upon mouse leaving its bounds upon a drag-and-drop operation.
protected virtual void ProcessDragLeave(Point oldMousePosition, ISupportDrag dragObject)
The previous mouse position.
dragObjectISupportDragThe object being dragged.
Determines whether the element may be treated as a drop target during drag-and-drop operation.
protected virtual bool ProcessDragOver(Point mousePosition, ISupportDrag dragObject)
The current mouse position.
dragObjectISupportDragThe object being dragged.
Returns:True if the element can accept the drop; otherwise, false.
Raises routed events in the bubble phase, handling key events specifically.
public override void RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
The element that raised the event.
argsRoutedEventArgsThe routed event arguments.
Overrides:
Add the VisualState property if we are in the context of RadControlSpy.
protected override PropertyDescriptorCollection ReplaceDefaultDescriptors(PropertyDescriptorCollection props)
Overrides:
Resets all overrides for the theme settings of a given property and a given state.
public void ResetThemeValueOverride(RadProperty property, string state)
The property to reset overrides for.
statestringThe state to reset.
Resets all overrides for the theme settings of a given property.
public void ResetThemeValueOverride(RadProperty property)
The property to reset overrides for.
Resets all theme override settings for this element.
public void ResetThemeValueOverrides()
Selects this item if it is selectable.
Sets the owner collection for this item.
protected virtual void SetOwnerCollection(RadItemOwnerCollection ownerCollection)
The collection that owns this item.
Applies the provided value as an override of the theme setting for the specified property in the specified state.
public void SetThemeValueOverride(RadProperty property, object value, string state, string childElementClass)
The property to override.
valueobjectThe value to override the theme setting with.
statestringThe 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.
childElementClassstringThe value of the Class property of the child element for which the override stands. (e.g. ButtonFill, ButtonBorder, etc.)
Applies the provided value as an override of the theme setting for the specified property in the specified state.
public void SetThemeValueOverride(RadProperty property, object value, string state, Type childElementType)
The property to override.
valueobjectThe value to override the theme setting with.
statestringThe 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.
childElementTypeTypeThe type of the child element for which the override stands. (e.g. typeof(FillPrimitive), typeof(BorderPrimitive), etc.)
Applies the provided value as an override of the theme setting for the specified property in the specified state.
public void SetThemeValueOverride(RadProperty property, object value, string state)
The property to override.
valueobjectThe value to override the theme setting with.
statestringThe 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.
Determines whether the property defined by the provided property descriptor should be serialized.
public override bool? ShouldSerializeProperty(PropertyDescriptor property)
bool?
Overrides:
protected virtual void UpdateOnShortcutsChanged()
Events
Occurs when the FlipText property value changes.
public event EventHandler FlipTextChanged
Occurs when the RadItem has focus and the user presses a key down.
public event KeyEventHandler KeyDown
Occurs when the RadItem has focus and the user presses a key.
public event KeyPressEventHandler KeyPress
Occurs when the RadItem has focus and the user releases the pressed key up.
public event KeyEventHandler KeyUp
Occurs when a pan gesture was sent by a touch input device.
[Browsable(true)]
public event PanGestureEventHandler PanGesture
Occurs when a press-and-tap gesture was sent by a touch input device.
[Browsable(true)]
public event PressAndTapGestureEventHandler PressAndTapGesture
Occurs when help is requested for an accessibility object.
public event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp
Occurs when a rotate gesture was sent by a touch input device.
[Browsable(true)]
public event RotateGestureEventHandler RotateGesture
Occurs when the Text property value changes.
public event EventHandler TextChanged
Occurs when the Text property value is about to be changed.
public event TextChangingEventHandler TextChanging
Occurs when the TextOrientation property value changes.
public event EventHandler TextOrientationChanged
Occurs when a two-finger-tap gesture was sent by a touch input device.
[Browsable(true)]
public event GestureEventHandler TwoFingerTapGesture
Occurs when a zoom gesture was sent by a touch input device.
[Browsable(true)]
public event ZoomGestureEventHandler ZoomGesture