BaseListViewElement
Represents an abstract base class for RadListView view elements providing core functionality for item virtualization, scrolling, selection management, keyboard navigation, and drag-drop operations. Extends VirtualizedScrollPanel<Item, Element> to provide specialized list view behavior with support for grouping, lasso selection, and various display modes.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public abstract class BaseListViewElement : VirtualizedScrollPanel<ListViewDataItem, BaseListViewVisualItem>, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementScrollViewElement<VirtualizedStackContainer<ListViewDataItem>>VirtualizedScrollPanel<ListViewDataItem, BaseListViewVisualItem>BaseListViewElement...
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the BaseListViewElement class with the specified owner. Configures scrolling behavior, timers for editing and selection, drag-drop support, and keyboard navigation functionality.
public BaseListViewElement(RadListViewElement owner)
The RadListViewElement that owns this base list view element.
Fields
public static RadProperty AllowArbitraryItemHeightProperty
public static RadProperty AllowArbitraryItemWidthProperty
protected ListViewDataItem anchor
protected Timer beginEditTimer
protected bool disableEditOnMouseUp
protected bool disableGroupSelectOnMouseUp
public static RadProperty DragHintProperty
public static RadProperty FullRowSelectProperty
public static RadProperty GroupIndentProperty
public static RadProperty GroupItemSizeProperty
protected Timer groupSelectionTimer
protected bool isLassoSelection
public static RadProperty ItemSizeProperty
lassoInitialSelection
Dictionary<ListViewDataItem, bool>
protected Dictionary<ListViewDataItem, bool> lassoInitialSelection
protected ListViewDataItem lastClickedItem
protected Keys lastModifierKeys
protected Point pointerOffset
protected BaseListViewVisualItem pressedItem
public static RadProperty SelectionRectangleBorderColorProperty
public static RadProperty SelectionRectangleColorProperty
protected Point startPoint
Properties
Gets or sets a value indicating whether the items can have different height.
public virtual bool AllowArbitraryItemHeight { get; set; }
Gets or sets a value indicating whether the items can have different width.
public virtual bool AllowArbitraryItemWidth { get; set; }
Gets or sets the RadImageShape instance which describes the hint that indicates where a column will be dropped after a drag operation.
[Browsable(false)]
[VsbBrowsable(true)]
public RadImageShape DragHint { get; set; }
Gets or sets an object that implements IFindStringComparer. The value of this property is used in the keyboard search functionality.
public IFindStringComparer FindStringComparer { get; set; }
Gets or sets a value indicating whether the full row should be selected.
public virtual bool FullRowSelect { get; set; }
Gets or sets the indent of the items when they are displayed in a group.
public virtual int GroupIndent { get; set; }
Gets or sets the default group item size.
public Size GroupItemSize { get; set; }
Gets or sets the display state of the horizontal scrollbar.
public ScrollState HorizontalScrollState { get; set; }
Gets or sets the orientation of the view element.
public override Orientation Orientation { get; set; }
Overrides:
Gets the RadListViewElement that owns the view.
public virtual RadListViewElement Owner { get; }
Gets the ScrollServiceBehavior that is responsible for the kinetic scrolling option.
public ScrollServiceBehavior ScrollBehavior { get; }
Determines if the group items can be selected.
public bool SelectGroupItems { get; set; }
Gets or sets the border color of the lasso selection rectangle.
[VsbBrowsable(true)]
public Color SelectionRectangleBorderColor { get; set; }
Gets or sets the fill color of the lasso selection rectangle.
[VsbBrowsable(true)]
public Color SelectionRectangleColor { get; set; }
Gets or sets the display state of the vertical scrollbar.
public ScrollState VerticalScrollState { get; set; }
Methods
Begins the lasso selection.
protected virtual void BeginLassoSelection()
Clears the selection.
public void ClearSelection()
Creates the element provider responsible for managing the creation and recycling of visual list view items.
protected override IVirtualizedElementProvider<ListViewDataItem> CreateElementProvider()
IVirtualizedElementProvider<ListViewDataItem>
A new ListViewVirtualizedElementProvider for visual item management.
Overrides:
Creates the item traverser responsible for navigating through the list view data items including group support.
protected override ITraverser<ListViewDataItem> CreateItemTraverser(IList<ListViewDataItem> items)
The collection of ListViewDataItem objects to traverse.
Returns:A new ListViewTraverser for item navigation.
Overrides:
Creates the view element container responsible for arranging and displaying list view items.
protected override VirtualizedStackContainer<ListViewDataItem> CreateViewElement()
VirtualizedStackContainer<ListViewDataItem>
A new BaseListViewContainer for managing item layout.
Overrides:
Disposes managed resources including timers used for editing, group selection, and lasso operations. Ensures proper cleanup of event handlers and timer resources.
protected override void DisposeManagedResources()
Overrides:
Ends the lasso selection.
protected virtual void EndLassoSelection()
Ensures that a given ListViewDataItem is visible on the client area.
public virtual void EnsureItemVisible(ListViewDataItem item, bool ensureHorizontally)
The ListViewDataItem to ensure visibility of.
ensureHorizontallyboolIndicates if the view should be scrolled horizontally.
Ensures that a given ListViewDataItem is visible on the client area.
public virtual void EnsureItemVisible(ListViewDataItem item)
The ListViewDataItem to ensure visibility of.
Ensures that a given ListViewDataItem is visible by scrolling the view horizontally.
protected virtual void EnsureItemVisibleHorizontal(ListViewDataItem item)
The item to ensure visibility of.
Ensures that a given ListViewDataItem is visible by scrolling the view vertically.
protected virtual void EnsureItemVisibleVertical(ListViewDataItem item)
The item to ensure visibility of.
Ensures that a given ListViewDataItem is visible when it is below the last visible item in the view.
protected virtual void EnsureItemVisibleVerticalCore(ListViewDataItem item)
The item to ensure visibility of.
Gets the drag hint location according to the specified item.
public virtual Point GetDragHintLocation(BaseListViewVisualItem visualItem, Point mouseLocation)
The drop target item.
mouseLocationPointThe mouse location in client coordinates.
Returns:The location of the drag hint.
Gets the size of the drag hint according to the speficied target.
public virtual Size GetDragHintSize(ISupportDrop target)
The drop target.
Returns:The size of the drag hint.
This method traverses through the items in the control and fills a queue with these items that start with the searchCriteria.
protected virtual ListViewDataItem GetFirstMatch(string searchCriteria)
Gets the ListViewDataItem at a specified location.
public ListViewDataItem GetItemAt(Point location)
The location.
Returns:The ListViewDataItem.
Gets the next visible item of a given ListViewDataItem.
protected virtual ListViewDataItem GetNextItem(ListViewDataItem currentItem)
The current item.
Returns:The next item.
Gets the previous visible item of a given ListViewDataItem.
protected virtual ListViewDataItem GetPreviousItem(ListViewDataItem currentItem)
The current item.
Returns:The previous item.
Gets the BaseListViewVisualItem at a specified location.
public virtual BaseListViewVisualItem GetVisualItemAt(Point location)
The location.
Returns:Handles a press of the Delete key.
Handles a press of the Down key.
Handles a press of the End key.
Handles a press of the Escape key.
Handles a press of the F2 key.
Handles a press of the Home key.
Handles a press of the Left key.
Handles navigation upon key press.
protected virtual void HandleNavigation(char keyChar)
The character of the pressed key.
Handles a press of the PageDown key.
Handles a press of the PageUp key.
Handles a press of the Right key.
Handles a press of the Space key.
Handles a press of the Up key.
Initializes the fields and properties specific to the BaseListViewElement. Configures default values and initializes the find string comparer for keyboard search functionality.
protected override void InitializeFields()
Overrides:
Called when the orientation of the view has changed.
protected virtual void OnOrientationChanged()
Handles property change events and updates the view when display-related properties change. Refreshes the view for properties affecting layout and appearance.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
The RadPropertyChangedEventArgs containing property change information.
Overrides:
protected virtual void OnScrollerUpdated()
Performs custom painting operations including rendering the lasso selection rectangle when active. Draws the selection rectangle with specified fill and border colors during drag selection.
protected override void PaintOverride(IGraphics screenRadGraphics, Rectangle clipRectangle, float angle, SizeF scale, bool useRelativeTransformation)
The graphics context for painting operations.
clipRectangleRectangleThe clipping rectangle to constrain painting.
anglefloatThe rotation angle for painting transformations.
scaleSizeFThe scaling factor for painting transformations.
useRelativeTransformationboolWhether to use relative transformation during painting.
Overrides:
Processes drag over events to determine whether drag-drop operations are allowed.
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 based on the owner's AllowDragDrop setting; otherwise, false.
Overrides:
protected virtual void ProcessItemLassoSelection(ListViewDataItem currentItem, bool isIntersecting)
Processes the KeyDown event.
protected virtual bool ProcessKeyDown(KeyEventArgs e)
The event args.
Returns:true if the processing of the event should be stopped, false otherwise.
protected virtual bool ProcessKeyPress(KeyPressEventArgs e)
Selects all items that are whitin the lasso rectangle.
protected void ProcessLassoSelection()
Selects all items that are whitin the specified rectangle.
protected virtual void ProcessLassoSelection(Rectangle selectionRect)
Processes the MouseDown event.
protected virtual bool ProcessMouseDown(MouseEventArgs e)
The event args.
Returns:true if the processing of the event should be stopped, false otherwise.
Processes the MouseMove event.
protected virtual bool ProcessMouseMove(MouseEventArgs e)
The event args.
Returns:true if the processing of the event should be stopped, false otherwise.
Processes the MouseUp event.
protected virtual bool ProcessMouseUp(MouseEventArgs e)
The event args.
Returns:true if the processing of the event should be stopped, false otherwise.
Processes the MouseWheel event.
protected virtual bool ProcessMouseWheel(MouseEventArgs e)
The event args.
Returns:true if the processing of the event should be stopped, false otherwise.
Processes the selection of a specified item.
protected virtual void ProcessSelection(ListViewDataItem item, Keys modifierKeys, bool isMouseSelection)
The ListViewDataItem which is being processed.
modifierKeysKeysThe modifier keys which are pressed during selection.
isMouseSelectionbool[true] if the selection is triggered by mouse input, [false] otherwise.
Scrolls the view with a given amount.
protected void SetScrollValue(RadScrollBarElement scrollbar, int newValue)
Indicates whether an item should be dropped after the given target according to the specified location.
public virtual bool ShouldDropAfter(BaseListViewVisualItem targetElement, Point dropLocation)
The drop target item.
dropLocationPointThe drop location.
Returns:[true] if a dropped item should be inserted after the target, [false] otherwise.
Returns a value indicating whether the current view supports given orientation.
protected virtual bool SupportsOrientation(Orientation orientation)
The orientation.
Returns:[true] if the current view supports the orientation, [false] otherwise.
Toggles the CheckState of given item.
protected void ToggleItemCheckState(ListViewDataItem item)
The item whose CheckState will be toggled.
Updates the horizontal scrollbar.
public virtual void UpdateHScrollbarMaximum()
Updates the visibility of the horizontal scrollbar.
protected virtual void UpdateHScrollbarVisibility()
Updates the view layout during measure operations, handling scrollbar visibility and client rectangle calculations. Configures horizontal scrollbar properties and updates maximum scroll values.