ClassBaseListViewVisualItem
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.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class BaseListViewVisualItem : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider, IVirtualizedElement<ListViewDataItem>
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementBaseListViewVisualItem
Derived Classes:
Implements:
Inherited Members
Constructors
BaseListViewVisualItem()
Declaration
public BaseListViewVisualItem()
Fields
IsControlInactiveProperty
Declaration
public static RadProperty IsControlInactiveProperty
Field Value
Properties
Current
Gets or sets a value indicating whether this list view item is the current item (has focus indicator).
Data
Gets the ListViewDataItem associated with this visual element.
Declaration
public ListViewDataItem Data { get; }
Property Value
Implements
IsControlActive
Gets a value indicating whether the owner control is currently active (has focus). This is the inverse of the IsControlInactive property.
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
[Browsable(false)]
public bool ItemHotTrackingEnabled { get; set; }
Property Value
Selected
Gets or sets a value indicating whether this list view item is currently selected.
ToggleElement
Gets the toggle element used for checkbox functionality in the list view item.
Declaration
public RadToggleButtonElement ToggleElement { get; }
Property Value
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
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
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.
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
data
The ListViewDataItem to attach to this visual element.
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
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
sender
The source of the event.
e
The 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
clientRect
The client rectangle to divide between elements.
toggleRectangle
The rectangle assigned to the toggle element.
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
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
clientRect
The client rectangle available for editor arrangement.
Returns
The 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
editor
The IValueEditor to get the visual element for.
Returns
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
data
The ListViewDataItem to check compatibility with.
context
Additional context information for the compatibility check.
Returns
True if this visual item can be reused for the specified data item; otherwise, false.
Implements
MeasureElements(SizeF, SizeF, Padding)
Measures all child elements when auto-sizing is enabled, calculating the space required for child elements.
Declaration
protected override SizeF MeasureElements(SizeF availableSize, SizeF clientSize, Padding borderThickness)
Parameters
availableSize
The available space that a parent element can allocate.
clientSize
The client area size available for content.
borderThickness
The thickness of the border that affects available space.
Returns
The desired size needed to accommodate all child elements.
Overrides
OnClick(EventArgs)
Handles the click event and notifies the owner list view of item click interactions.
OnDoubleClick(EventArgs)
Handles the double-click event and notifies the owner list view of item double-click interactions.
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
e
The 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.
OnMouseHover(EventArgs)
Handles the mouse hover event and notifies the owner list view of item hover state.
OnMouseLeave(EventArgs)
Handles the mouse leave event and notifies the owner list view when the mouse exits the item area.
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
e
The 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
e
The 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
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
args
The StateChangingEventArgs containing state change information.
Returns
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
mousePosition
The current mouse position during the drag operation.
dragObject
The object being dragged that implements ISupportDrag.
Returns
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
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()