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
public BaseListViewVisualItem()
Fields
public static RadProperty CurrentProperty
protected ListViewDataItem dataItem
public static RadProperty HotTrackingProperty
public static RadProperty IsControlInactiveProperty
public static RadProperty SelectedProperty
Properties
Gets or sets a value indicating whether this list view item is the current item (has focus indicator).
[Browsable(false)]
public bool Current { get; }
Gets the ListViewDataItem associated with this visual element.
public ListViewDataItem Data { get; }
Implements:
public IInputEditor Editor { get; }
Gets a value indicating whether the owner control is currently active (has focus). This is the inverse of the IsControlInactive property.
public bool IsControlActive { get; }
public bool IsInEditMode { get; }
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.
[Browsable(false)]
public bool ItemHotTrackingEnabled { get; set; }
Gets or sets a value indicating whether this list view item is currently selected.
[Browsable(false)]
public bool Selected { get; }
Gets the toggle element used for checkbox functionality in the list view item.
public RadToggleButtonElement ToggleElement { get; }
Methods
Adds an editor element to the visual item for in-place editing of content.
public virtual void AddEditor(IInputEditor editor)
The IInputEditor to add for editing this visual item.
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.
protected virtual void ArrangeContentCore(RectangleF clientRect)
The client rectangle available for content arrangement.
Arranges the child elements of the list view item within the specified final size including toggle element and editor positioning.
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.
public virtual void Attach(ListViewDataItem data, object context)
The ListViewDataItem to attach to this visual element.
contextobjectAdditional context information for the attachment operation.
Implements:
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.
protected override void CreateChildElements()
Overrides:
Creates the toggle element used for checkbox functionality in the list view item.
protected virtual RadToggleButtonElement CreateToggleElement()
A new RadToggleButtonElement configured as a checkbox for the item.
Handles property changed events from the associated data item and updates the visual representation accordingly. Suspends layout during updates and triggers visual item formatting.
protected virtual void DataPropertyChanged(object sender, PropertyChangedEventArgs e)
The source of the event.
ePropertyChangedEventArgsThe PropertyChangedEventArgs containing property change information.
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.
public virtual void Detach()
Implements:
Disposes managed resources by detaching from the associated data item and performing base cleanup operations.
protected override void DisposeManagedResources()
Overrides:
Calculates the arrangement rectangles for the toggle element and layout manager based on checkbox position settings.
protected void GetArrangeRectangles(RectangleF clientRect, out RectangleF toggleRectangle, out RectangleF layoutManagerRect)
The client rectangle to divide between elements.
toggleRectangleRectangleFThe rectangle assigned to the toggle element.
layoutManagerRectRectangleFThe rectangle assigned to the layout manager for content.
Gets the checkbox position setting from the owner list view for checkbox placement within this visual item.
protected virtual CheckBoxesPosition GetCheckBoxesPosition()
The CheckBoxesPosition indicating where checkboxes should be positioned.
Gets the arrangement rectangle for editor elements when the visual item enters edit mode.
protected virtual RectangleF GetEditorArrangeRectangle(RectangleF clientRect)
The client rectangle available for editor arrangement.
Returns:The RectangleF defining the editor's arrangement area.
Gets the visual element associated with the specified editor for display in this visual item.
protected virtual RadItem GetEditorElement(IValueEditor editor)
The IValueEditor to get the visual element for.
Returns:The RadItem representing the visual editor element, or null if not available.
Determines whether this visual item is compatible with the specified data item and context for reuse in virtualization.
public virtual bool IsCompatible(ListViewDataItem data, object context)
The ListViewDataItem to check compatibility with.
contextobjectAdditional context information for the compatibility check.
Returns:True if this visual item can be reused for the specified data item; otherwise, false.
Implements:
Measures all child elements when auto-sizing is enabled, calculating the space required for child elements.
protected override SizeF MeasureElements(SizeF availableSize, SizeF clientSize, Padding borderThickness)
The available space that a parent element can allocate.
clientSizeSizeFThe client area size available for content.
borderThicknessPaddingThe thickness of the border that affects available space.
Returns:The desired size needed to accommodate all child elements.
Overrides:
Handles the mouse down event and initiates selection or checkbox toggling based on the click location.
protected override void OnMouseDown(MouseEventArgs e)
The MouseEventArgs containing event data.
Overrides:
Handles the mouse move event and notifies the owner list view of item mouse tracking.
protected override void OnMouseMove(MouseEventArgs e)
The MouseEventArgs containing event data.
Overrides:
Handles the mouse up event and completes selection or checkbox interaction operations.
protected override void OnMouseUp(MouseEventArgs e)
The MouseEventArgs containing event data.
Overrides:
Handles property change events, specifically managing hot tracking behavior based on mouse over state and owner settings.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
The RadPropertyChangedEventArgs containing property change information.
Overrides:
Handles the toggle button state changing event and updates the associated data item's check state.
protected virtual bool OnToggleButtonStateChanging(StateChangingEventArgs args)
The StateChangingEventArgs containing state change information.
Returns:True if the state change should be cancelled; otherwise, false.
Processes drag over events to determine whether drag-drop operations are allowed based on the owner's AllowDragDrop setting.
protected override bool ProcessDragOver(Point mousePosition, ISupportDrag dragObject)
The current mouse position during the drag operation.
dragObjectISupportDragThe object being dragged that implements ISupportDrag.
Returns:True if drag-drop is allowed; otherwise, false.
Overrides:
Removes an editor element from the visual item and terminates in-place editing.
public virtual void RemoveEditor(IInputEditor editor)
The IInputEditor to remove from this visual item.
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.
protected virtual void ResetProperties()
Synchronizes the visual properties and state of this item with its associated ListViewDataItem. Updates text, images, styling, and raises the visual item formatting event.
public void Synchronize()
Implements:
Synchronizes the visual properties of this item with the associated data item including appearance, checkbox state, text, images, and styling properties.
protected virtual void SynchronizeProperties()
Unwires event handlers from the associated data item to prevent memory leaks.
protected virtual void UnwireItemEvents()
Wires up event handlers to the associated data item to respond to property changes.
protected virtual void WireItemEvents()