Class BaseListViewVisualItem
Represents the base visual element for list view data items, providing the visual representation and user interaction functionality for ListViewDataItem objects. Implements IVirtualizedElement<T> to support item virtualization and extends LightVisualElement to provide core visual functionality including selection, hover states, checkboxes, and editing capabilities.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class BaseListViewVisualItem : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider, IVirtualizedElement<ListViewDataItem>
Constructors
BaseListViewVisualItem()
Declaration
public BaseListViewVisualItem()
Fields
CurrentProperty
dataItem
HotTrackingProperty
IsControlInactiveProperty
SelectedProperty
Properties
Current
Gets or sets a value indicating whether this list view item is the current item (has focus indicator).
Declaration
public bool Current { get; }
Property Value
|
System.Boolean
|
Data
Gets the ListViewDataItem associated with this visual element.
Declaration
public ListViewDataItem Data { get; }
Property Value
|
ListViewDataItem
|
Implements
Editor
IsControlActive
Gets a value indicating whether the owner control is currently active (has focus). This is the inverse of the IsControlInactive property.
Declaration
public bool IsControlActive { get; }
Property Value
|
System.Boolean
|
IsInEditMode
Declaration
public bool IsInEditMode { get; }
Property Value
|
System.Boolean
|
ItemHotTrackingEnabled
Gets or sets a value indicating whether hot tracking is enabled for this item. When enabled, the item responds to mouse hover events with visual feedback.
Declaration
public bool ItemHotTrackingEnabled { get; set; }
Property Value
|
System.Boolean
|
Selected
Gets or sets a value indicating whether this list view item is currently selected.
Declaration
public bool Selected { get; }
Property Value
|
System.Boolean
|
ToggleElement
Gets the toggle element used for checkbox functionality in the list view item.
Declaration
public RadToggleButtonElement ToggleElement { get; }
Property Value
|
RadToggleButtonElement
|
Methods
AddEditor(IInputEditor)
Adds an editor element to the visual item for in-place editing of content.
Declaration
public virtual void AddEditor(IInputEditor editor)
Parameters
|
IInputEditor
editor
The IInputEditor to add for editing this visual item. |
ArrangeContentCore(RectangleF)
Arranges the content of the list view item including toggle element, layout manager, and editor positioning. Handles RTL layout translation and calculates appropriate rectangles for each element.
Declaration
protected virtual void ArrangeContentCore(RectangleF clientRect)
Parameters
|
System.Drawing.RectangleF
clientRect
The client rectangle available for content arrangement. |
ArrangeOverride(SizeF)
Arranges the child elements of the list view item within the specified final size including toggle element and editor positioning.
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
|
System.Drawing.SizeF
finalSize
The final area within which this element should arrange itself and its children. |
Returns
|
System.Drawing.SizeF
The actual size used by this element after arrangement. |
Overrides
Attach(ListViewDataItem, Object)
Attaches the visual item to the specified data item and context, establishing the connection for data binding and event handling. Wires up event handlers and synchronizes the visual properties with the data item.
Declaration
public virtual void Attach(ListViewDataItem data, object context)
Parameters
|
ListViewDataItem
data
The ListViewDataItem to attach to this visual element. |
|
System.Object
context
Additional context information for the attachment operation. |
Implements
CreateChildElements()
Creates the child elements for the list view visual item including the toggle element for checkbox functionality. Configures default properties for stretching, alignment, drag-drop support, and visual appearance.
Declaration
protected override void CreateChildElements()
Overrides
CreateToggleElement()
Creates the toggle element used for checkbox functionality in the list view item.
Declaration
protected virtual RadToggleButtonElement CreateToggleElement()
Returns
|
RadToggleButtonElement
A new RadToggleButtonElement configured as a checkbox for the item. |
DataPropertyChanged(Object, PropertyChangedEventArgs)
Handles property changed events from the associated data item and updates the visual representation accordingly. Suspends layout during updates and triggers visual item formatting.
Declaration
protected virtual void DataPropertyChanged(object sender, PropertyChangedEventArgs e)
Parameters
|
System.Object
sender
The source of the event. |
|
System.ComponentModel.PropertyChangedEventArgs
e
The System.ComponentModel.PropertyChangedEventArgs containing property change information. |
Detach()
Detaches the visual item from its associated data item, cleaning up event handlers and resetting properties. Handles edit mode cancellation and editor removal if the item is currently being edited.
Declaration
public virtual void Detach()
Implements
DisposeManagedResources()
Disposes managed resources by detaching from the associated data item and performing base cleanup operations.
Declaration
protected override void DisposeManagedResources()
Overrides
GetArrangeRectangles(RectangleF, out RectangleF, out RectangleF)
Calculates the arrangement rectangles for the toggle element and layout manager based on checkbox position settings.
Declaration
protected void GetArrangeRectangles(RectangleF clientRect, out RectangleF toggleRectangle, out RectangleF layoutManagerRect)
Parameters
|
System.Drawing.RectangleF
clientRect
The client rectangle to divide between elements. |
|
System.Drawing.RectangleF
toggleRectangle
The rectangle assigned to the toggle element. |
|
System.Drawing.RectangleF
layoutManagerRect
The rectangle assigned to the layout manager for content. |
GetCheckBoxesPosition()
Gets the checkbox position setting from the owner list view for checkbox placement within this visual item.
Declaration
protected virtual CheckBoxesPosition GetCheckBoxesPosition()
Returns
|
CheckBoxesPosition
The CheckBoxesPosition indicating where checkboxes should be positioned. |
GetEditorArrangeRectangle(RectangleF)
Gets the arrangement rectangle for editor elements when the visual item enters edit mode.
Declaration
protected virtual RectangleF GetEditorArrangeRectangle(RectangleF clientRect)
Parameters
|
System.Drawing.RectangleF
clientRect
The client rectangle available for editor arrangement. |
Returns
|
System.Drawing.RectangleF
The System.Drawing.RectangleF defining the editor's arrangement area. |
GetEditorElement(IValueEditor)
Gets the visual element associated with the specified editor for display in this visual item.
Declaration
protected virtual RadItem GetEditorElement(IValueEditor editor)
Parameters
|
IValueEditor
editor
The IValueEditor to get the visual element for. |
Returns
|
RadItem
The RadItem representing the visual editor element, or null if not available. |
IsCompatible(ListViewDataItem, Object)
Determines whether this visual item is compatible with the specified data item and context for reuse in virtualization.
Declaration
public virtual bool IsCompatible(ListViewDataItem data, object context)
Parameters
|
ListViewDataItem
data
The ListViewDataItem to check compatibility with. |
|
System.Object
context
Additional context information for the compatibility check. |
Returns
|
System.Boolean
True if this visual item can be reused for the specified data item; otherwise, false. |
Implements
MeasureElements(SizeF, SizeF, Padding)
Declaration
protected override SizeF MeasureElements(SizeF availableSize, SizeF clientSize, Padding borderThickness)
Parameters
|
System.Drawing.SizeF
availableSize
|
|
System.Drawing.SizeF
clientSize
|
|
System.Windows.Forms.Padding
borderThickness
|
Returns
|
System.Drawing.SizeF
|
Overrides
OnClick(EventArgs)
Handles the click event and notifies the owner list view of item click interactions.
Declaration
protected override void OnClick(EventArgs e)
Parameters
|
System.EventArgs
e
The System.EventArgs containing event data. |
Overrides
OnDoubleClick(EventArgs)
Handles the double-click event and notifies the owner list view of item double-click interactions.
Declaration
protected override void OnDoubleClick(EventArgs e)
Parameters
|
System.EventArgs
e
The System.EventArgs containing event data. |
Overrides
OnMouseDown(MouseEventArgs)
Handles the mouse down event and initiates selection or checkbox toggling based on the click location.
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
|
System.Windows.Forms.MouseEventArgs
e
The System.Windows.Forms.MouseEventArgs containing event data. |
Overrides
OnMouseEnter(EventArgs)
Handles the mouse enter event and notifies the owner list view when the mouse enters the item area.
Declaration
protected override void OnMouseEnter(EventArgs e)
Parameters
|
System.EventArgs
e
The System.EventArgs containing event data. |
Overrides
OnMouseHover(EventArgs)
Handles the mouse hover event and notifies the owner list view of item hover state.
Declaration
protected override void OnMouseHover(EventArgs e)
Parameters
|
System.EventArgs
e
The System.EventArgs containing event data. |
Overrides
OnMouseLeave(EventArgs)
Handles the mouse leave event and notifies the owner list view when the mouse exits the item area.
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
|
System.EventArgs
e
The System.EventArgs containing event data. |
Overrides
OnMouseMove(MouseEventArgs)
Handles the mouse move event and notifies the owner list view of item mouse tracking.
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
|
System.Windows.Forms.MouseEventArgs
e
The System.Windows.Forms.MouseEventArgs containing event data. |
Overrides
OnMouseUp(MouseEventArgs)
Handles the mouse up event and completes selection or checkbox interaction operations.
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
|
System.Windows.Forms.MouseEventArgs
e
The System.Windows.Forms.MouseEventArgs containing event data. |
Overrides
OnPropertyChanged(RadPropertyChangedEventArgs)
Handles property change events, specifically managing hot tracking behavior based on mouse over state and owner settings.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
|
RadPropertyChangedEventArgs
e
The RadPropertyChangedEventArgs containing property change information. |
Overrides
OnToggleButtonStateChanging(StateChangingEventArgs)
Handles the toggle button state changing event and updates the associated data item's check state.
Declaration
protected virtual bool OnToggleButtonStateChanging(StateChangingEventArgs args)
Parameters
|
StateChangingEventArgs
args
The StateChangingEventArgs containing state change information. |
Returns
|
System.Boolean
True if the state change should be cancelled; otherwise, false. |
ProcessDragOver(Point, ISupportDrag)
Processes drag over events to determine whether drag-drop operations are allowed based on the owner's AllowDragDrop setting.
Declaration
protected override bool ProcessDragOver(Point mousePosition, ISupportDrag dragObject)
Parameters
|
System.Drawing.Point
mousePosition
The current mouse position during the drag operation. |
|
ISupportDrag
dragObject
The object being dragged that implements ISupportDrag. |
Returns
|
System.Boolean
True if drag-drop is allowed; otherwise, false. |
Overrides
RemoveEditor(IInputEditor)
Removes an editor element from the visual item and terminates in-place editing.
Declaration
public virtual void RemoveEditor(IInputEditor editor)
Parameters
|
IInputEditor
editor
The IInputEditor to remove from this visual item. |
ResetProperties()
Resets the visual properties of the item to their default values, typically called during detachment or recycling. Clears font, color, alignment, and other visual styling properties.
Declaration
protected virtual void ResetProperties()
Synchronize()
Synchronizes the visual properties and state of this item with its associated ListViewDataItem. Updates text, images, styling, and raises the visual item formatting event.
Declaration
public void Synchronize()
Implements
SynchronizeProperties()
Synchronizes the visual properties of this item with the associated data item including appearance, checkbox state, text, images, and styling properties.
Declaration
protected virtual void SynchronizeProperties()
UnwireItemEvents()
Unwires event handlers from the associated data item to prevent memory leaks.
Declaration
protected virtual void UnwireItemEvents()
WireItemEvents()
Wires up event handlers to the associated data item to respond to property changes.
Declaration
protected virtual void WireItemEvents()