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