RadListView
Displays a flat collection of labeled items, each represented by a ListViewDataItem.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[TelerikToolboxCategory("Data Controls")]
[ComplexBindingProperties("DataSource", "DataMember")]
[LookupBindingProperties("DataSource", "DisplayMember", "ValueMember", "CurrentItem")]
public class RadListView : RadControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider, IFilterable
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadListView...
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadListView control with default settings and empty item collection.
public RadListView()
Properties
Gets the currently active editor.
[Browsable(false)]
public IInputEditor ActiveEditor { get; }
Gets or sets a value indicating whether the items can have different height.
[Browsable(true)]
public virtual bool AllowArbitraryItemHeight { get; set; }
Gets or sets a value indicating whether the items can have different width.
[Browsable(true)]
public bool AllowArbitraryItemWidth { get; set; }
Gets or sets a value indicating whether users can reorder columns by dragging column headers in DetailsView mode.
[Browsable(true)]
public virtual bool AllowColumnReorder { get; set; }
Gets or sets a value indicating whether users can resize column widths by dragging column borders in DetailsView mode.
[Browsable(true)]
public virtual bool AllowColumnResize { get; set; }
Gets or sets a value indicating whether users can reorder items by dragging them to different positions.
[Browsable(true)]
public virtual bool AllowDragDrop { get; set; }
Gets or sets value indicating whether editing is enabled.
[Browsable(true)]
public virtual bool AllowEdit { get; set; }
Gets or sets a value indicating whether users can remove selected items by pressing the Delete key.
[Browsable(true)]
public bool AllowRemove { get; set; }
Gets or sets a value indicating how column widths in DetailsView mode are determined.
[Browsable(true)]
public ListViewAutoSizeColumnsMode AutoSizeColumnsMode { get; set; }
Gets or sets a value indicating whether column names which differ only in casing are treated as different columns.
[Browsable(true)]
public bool CaseSensitiveColumnNames { get; set; }
Gets or sets the vertical alignment of checkboxes within each item when ShowCheckBoxes is enabled.
[Browsable(true)]
public CheckBoxesAlignment CheckBoxesAlignment { get; set; }
Gets or sets the position of checkboxes relative to the item content when ShowCheckBoxes is enabled.
[Browsable(true)]
public CheckBoxesPosition CheckBoxesPosition { get; set; }
Gets a collection containing the checked items.
[Browsable(false)]
public ListViewCheckedItemCollection CheckedItems { get; }
Gets or sets the checked member.
[Browsable(true)]
public string CheckedMember { get; set; }
Gets or sets a value indicating the conditions under which an item's check state automatically changes when the item is clicked.
[Browsable(true)]
public virtual CheckOnClickMode CheckOnClickMode { get; set; }
Gets a collection of ListViewDetailColumn objects that define the columns displayed in DetailsView mode.
[Browsable(true)]
public ListViewColumnCollection Columns { get; }
Gets or sets the current column in Details View.
[Browsable(false)]
public ListViewDetailColumn CurrentColumn { get; set; }
Gets or sets the current item.
[Browsable(false)]
public ListViewDataItem CurrentItem { get; set; }
Gets or sets the specific list or table within the data source that the RadListView should bind to when the data source contains multiple lists.
[Browsable(true)]
public string DataMember { get; set; }
Gets or sets the data source of a RadListView.
[Browsable(true)]
public virtual object DataSource { get; set; }
Gets the default size for the RadListView.
protected override Size DefaultSize { get; }
Overrides:
Gets or sets the name of the data source property that provides the display text for each item when data binding is used.
[Browsable(true)]
[TypeConverter("System.Windows.Forms.Design.DataMemberFieldConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public string DisplayMember { get; set; }
Gets or sets a value indicating whether clicking on column headers in DetailsView mode will sort the items by that column.
[Browsable(true)]
public bool EnableColumnSort { get; set; }
Gets or sets a value indicating whether custom grouping is enabled.
[Browsable(true)]
public virtual bool EnableCustomGrouping { get; set; }
Gets or sets a value indicating whether filtering is enabled.
[Browsable(true)]
public bool EnableFiltering { get; set; }
Gets or sets a value indicating whether grouping is enabled.
[Browsable(true)]
public bool EnableGrouping { get; set; }
Gets or sets a value indicating whether kinetic scrolling is enabled for smooth touch-based scrolling. This is automatically disabled when lasso selection is enabled.
[Browsable(true)]
public bool EnableKineticScrolling { get; set; }
Gets or sets a value indicating whether users can select multiple items by dragging a selection rectangle around them.
[Browsable(true)]
public bool EnableLassoSelection { get; set; }
Gets or sets a value indicating whether sorting is enabled.
[Browsable(true)]
public bool EnableSorting { get; set; }
Gets a collection of filter descriptors that define the filtering criteria applied to the ListView items.
[Browsable(true)]
public ListViewFilterDescriptorCollection FilterDescriptors { get; }
Gets or sets a custom predicate function used to filter items in the ListView based on complex criteria.
[Browsable(false)]
public Predicate<ListViewDataItem> FilterPredicate { get; set; }
Gets or sets the string comparer used by the keyboard navigation functionality.
[Browsable(true)]
public IFindStringComparer FindStringComparer { get; set; }
Gets or sets a value indicating whether the entire row is highlighted when an item is selected in DetailsView mode, rather than just the first column.
[Browsable(true)]
public virtual bool FullRowSelect { get; set; }
Gets a collection of group descriptors that define the grouping criteria applied to organize ListView items into groups.
[Browsable(true)]
public GroupDescriptorCollection GroupDescriptors { get; }
Gets or sets the horizontal indentation applied to items when they are displayed within a group.
[Browsable(true)]
public virtual int GroupIndent { get; set; }
Gets or sets the default size for group header items when grouping is enabled.
[Browsable(true)]
public virtual Size GroupItemSize { get; set; }
Gets a collection containing all the groups that organize items in the RadListView when grouping is enabled.
[Browsable(true)]
public virtual ListViewDataItemGroupCollection Groups { get; }
Gets or sets the height of the header in Details View.
[Browsable(true)]
public virtual float HeaderHeight { get; set; }
Gets or sets the display behavior of the horizontal scrollbar, controlling when it appears and how it behaves.
[Browsable(true)]
public ScrollState HorizontalScrollState { get; set; }
Gets or sets a value indicating whether items should react on mouse hover.
[Browsable(true)]
public bool HotTracking { get; set; }
Gets a value indicating whether the RadListView is currently bound to a data source.
[Browsable(false)]
public bool IsDataBound { get; }
Indicates whether there is an active editor.
[Browsable(false)]
public bool IsEditing { get; }
Gets a collection of ListViewDataItem objects that represent all items displayed in the RadListView.
[Browsable(true)]
public ListViewDataItemCollection Items { get; }
Gets or sets the default size for items when they are displayed in the ListView.
[Browsable(true)]
public virtual Size ItemSize { get; set; }
Gets or sets the amount of spacing in pixels between adjacent items in the ListView.
[Browsable(true)]
public virtual int ItemSpacing { get; set; }
Gets or sets a value indicating whether users can search for items by typing characters when the RadListView has focus.
[Browsable(true)]
public bool KeyboardSearchEnabled { get; set; }
Gets or sets a value that specifies how long the user must wait before searching with the keyboard is reset.
[Browsable(true)]
public int KeyboardSearchResetInterval { get; set; }
Gets the underlying RadListViewElement that provides the core functionality and visual representation of the ListView.
[Browsable(false)]
public RadListViewElement ListViewElement { get; }
Gets or sets value indicating whether multi selection is enabled.
[Browsable(true)]
public bool MultiSelect { get; set; }
Gets or sets the index of the selected item.
[Browsable(false)]
[Bindable(true)]
public int SelectedIndex { get; set; }
Gets or sets the selected item.
[Browsable(false)]
[Bindable(true)]
public ListViewDataItem SelectedItem { get; set; }
Gets a collection containing the selected items.
[Browsable(false)]
public ListViewSelectedItemCollection SelectedItems { get; }
Gets or sets a value indicating whether the most recently added item to the data source should be automatically selected.
[Browsable(true)]
public bool SelectLastAddedItem { get; set; }
Gets or sets a value indicating whether checkboxes are displayed next to each item for selection purposes.
[Browsable(true)]
public virtual bool ShowCheckBoxes { get; set; }
Gets or sets a value indicating whether column headers are visible in DetailsView mode.
[Browsable(true)]
public virtual bool ShowColumnHeaders { get; set; }
Gets or sets a value indicating whether grid lines are displayed between items and columns in DetailsView mode.
[Browsable(true)]
public virtual bool ShowGridLines { get; set; }
Gets or sets a value indicating whether items are organized and displayed within their respective groups.
[Browsable(true)]
public virtual bool ShowGroups { get; set; }
Gets a collection of sort descriptors that define the sorting criteria and order applied to the ListView items.
[Browsable(true)]
public SortDescriptorCollection SortDescriptors { get; }
Gets or sets a value indicating whether checkboxes support three states: checked, unchecked, and indeterminate.
[Browsable(true)]
public bool ThreeStateMode { get; set; }
Gets or sets the name of the data source property that provides the value for each item when data binding is used.
[Browsable(true)]
public string ValueMember { get; set; }
Gets or sets the display behavior of the vertical scrollbar, controlling when it appears and how it behaves.
[Browsable(true)]
public ScrollState VerticalScrollState { get; set; }
Gets or sets the view mode that determines how items are displayed, such as ListView, DetailsView, IconView.
[Browsable(true)]
public virtual ListViewType ViewType { get; set; }
Methods
Begins an edit operation over the currently selected item.
public bool BeginEdit()
True if editing was successfully started; false if editing could not be initiated
Suspend any item change notifications until RadListView.EndUpdate is called.
public void BeginUpdate()
Ends the current edit operations if such. Discards the changes.
public bool CancelEdit()
True if editing was successfully canceled; false otherwise
Determines whether the specified RadElement can be edited at design time in the Visual Studio designer.
protected override bool CanEditElementAtDesignTime(RadElement element)
The RadElement to check for design-time editability
Returns:True if the element can be edited at design time; otherwise, false
Overrides:
Checks all of the items.
public void CheckAllItems()
Checks the selected items.
public void CheckSelectedItems()
Collapses all the groups in the control.
public void CollapseAll()
Creates and returns the accessibility object that provides information to assistive technology applications.
protected override AccessibleObject CreateAccessibilityInstance()
An AccessibleObject that represents the RadListView for accessibility purposes
Overrides:
Creates the child elements of the RadListView control, including the main list view element.
protected override void CreateChildItems(RadElement parent)
The parent RadElement that will contain the child elements
Overrides:
Creates and returns a new instance of the RadListViewElement that provides the core functionality for the control.
protected virtual RadListViewElement CreateListViewElement()
A new RadListViewElement instance
Ends the current edit operations if such. Saves the changes.
public bool EndEdit()
True if editing was successfully completed and changes were saved; false otherwise
Resumes the item change notifications.
public void EndUpdate()
Expands all the groups in the control.
public void ExpandAll()
Finds an item with the specified key.
public ListViewDataItem FindItemByKey(object key, bool searchVisibleItems)
The key value to search for among the items
searchVisibleItemsboolTrue to search only currently visible items; false to search all items
Returns:The first ListViewDataItem with the specified key, or null if no matching item is found
Finds an item with the specified key.
public ListViewDataItem FindItemByKey(object key)
The key value to search for among the items
Returns:The first ListViewDataItem with the specified key, or null if no matching item is found
Handles the GotFocus event and performs initialization operations when the control receives input focus.
protected override void OnGotFocus(EventArgs e)
Event arguments containing information about the focus change
Overrides:
Handles key press events and delegates processing to the list view element for navigation and selection.
protected override void OnKeyDown(KeyEventArgs e)
Key event arguments containing information about the key press
Overrides:
Handles character input events and delegates processing to the list view element for keyboard search functionality.
protected override void OnKeyPress(KeyPressEventArgs e)
Key press event arguments containing information about the character input
Overrides:
Called when the control is loaded.
protected override void OnLoad(Size desiredSize)
The desired size for the control
Overrides:
Handles the LostFocus event and performs cleanup operations when the control loses input focus.
protected override void OnLostFocus(EventArgs e)
Event arguments containing information about the focus change
Overrides:
Handles mouse button press events and delegates processing to the list view element.
protected override void OnMouseDown(MouseEventArgs e)
Mouse event arguments containing information about the button press
Overrides:
Handles mouse movement events and delegates processing to the list view element for hit testing and hover effects.
protected override void OnMouseMove(MouseEventArgs e)
Mouse event arguments containing information about the mouse movement
Overrides:
Handles mouse button release events and delegates processing to the list view element.
protected override void OnMouseUp(MouseEventArgs e)
Mouse event arguments containing information about the button release
Overrides:
Handles mouse wheel events and delegates processing to the list view element for scrolling functionality.
protected override void OnMouseWheel(MouseEventArgs e)
Mouse event arguments containing information about the mouse wheel operation
Overrides:
Handles property change notifications and performs special processing for filter predicate changes in custom grouping scenarios.
protected override void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
Property change event arguments containing the name of the property that changed
Overrides:
Handles theme name changes and performs necessary cleanup and reinitialization of visual elements.
protected override void OnThemeNameChanged(ThemeNameChangedEventArgs e)
Event arguments containing information about the theme change
Overrides:
Handles the initialization completion event and applies any property values that were set during the initialization phase.
Selects a set of items.
public void Select(ListViewDataItem[] items)
An array of ListViewDataItem objects to select
Unchecks all of the items.
public void UncheckAllItems()
Unchecks the selected items.
public void UncheckSelectedItems()
Events
Occurs when the process of binding the RadListViewElement to a data source has finished successfully.
public event EventHandler BindingCompleted
Occurs when the binding context for the RadListView has changed, typically during data binding operations.
public event EventHandler BindingContextChanged
Occurs when a new DetailListViewCellElement needs to be created for displaying cell content in DetailsView mode.
public virtual event ListViewCellElementCreatingEventHandler CellCreating
Occurs when a cell in DetailsView mode needs to be formatted, allowing custom appearance to be applied.
public virtual event ListViewCellFormattingEventHandler CellFormatting
Occurs when a new ListViewDetailColumn needs to be created for DetailsView mode.
public event ListViewColumnCreatingEventHandler ColumnCreating
Occurs when the CurrentItem property has been changed to point to a different item.
public event ListViewItemEventHandler CurrentItemChanged
Occurs when the CurrentItem property is about to change to a different item. This event is cancelable.
public event ListViewItemChangingEventHandler CurrentItemChanging
Occurs when an editor control has been initialized and is ready for user input.
public event ListViewItemEditorInitializedEventHandler EditorInitialized
Occurs when an editor control is required for in-place editing of an item's value.
public event ListViewItemEditorRequiredEventHandler EditorRequired
Occurs when a group has been expanded and is now displaying its child items.
public event EventHandler<ListViewGroupEventArgs> GroupExpanded
Occurs when a group is about to expand and display its child items. This event is cancelable.
public event EventHandler<ListViewGroupCancelEventArgs> GroupExpanding
Occurs when a ListViewDataItem has had its checked state changed successfully.
public event ListViewItemEventHandler ItemCheckedChanged
Occurs when a ListViewDataItem is about to have its checked state changed. This event is cancelable.
public event ListViewItemCancelEventHandler ItemCheckedChanging
Occurs when a new ListViewDataItem needs to be created, allowing custom item types to be provided.
public event ListViewItemCreatingEventHandler ItemCreating
Occurs when a data-bound object is being attached to a ListViewDataItem during the data binding process.
public event ListViewItemEventHandler ItemDataBound
Occurs when a ListViewDataItem has been successfully edited and the changes have been committed.
public event ListViewItemEditedEventHandler ItemEdited
Occurs when an edit operation is about to begin on an item. This event is cancelable.
public event ListViewItemEditingEventHandler ItemEditing
Occurs when the user single-clicks on a ListViewDataItem with any mouse button.
public event ListViewItemEventHandler ItemMouseClick
Occurs when the user double-clicks on a ListViewDataItem with the primary mouse button.
public event ListViewItemEventHandler ItemMouseDoubleClick
Occurs when the user presses a mouse button while the mouse pointer is positioned over a ListViewDataItem.
public event ListViewItemMouseEventHandler ItemMouseDown
Occurs when the mouse pointer enters the boundaries of a ListViewDataItem.
public event ListViewItemEventHandler ItemMouseEnter
Occurs when the user pauses the mouse pointer over a ListViewDataItem for a predefined period of time.
public event ListViewItemEventHandler ItemMouseHover
Occurs when the mouse pointer leaves the boundaries of a ListViewDataItem.
public event ListViewItemEventHandler ItemMouseLeave
Occurs when the user moves the mouse pointer while it is positioned over a ListViewDataItem.
public event ListViewItemMouseEventHandler ItemMouseMove
Occurs when the user releases a mouse button while the mouse pointer is positioned over a ListViewDataItem.
public event ListViewItemMouseEventHandler ItemMouseUp
Occurs when an item has been successfully removed from the collection using the Delete key.
public event ListViewItemEventHandler ItemRemoved
Occurs when an item is about to be removed from the collection using the Delete key. This event is cancelable.
public event ListViewItemCancelEventHandler ItemRemoving
Occurs when an edit operation needs to be validated.
public event ListViewItemValidatingEventHandler ItemValidating
Occurs when the value of a ListViewDataItem has been successfully changed.
public event ListViewItemValueChangedEventHandler ItemValueChanged
Occurs when the value of a ListViewDataItem is about to change. This event is cancelable.
public event ListViewItemValueChangingEventHandler ItemValueChanging
Occurs when the selected item has changed.
public event EventHandler SelectedIndexChanged
Occurs when the selected item has changed.
public event EventHandler SelectedItemChanged
Occurs when a ListViewDataItem is about to be selected, allowing the selection operation to be canceled.
public event ListViewItemCancelEventHandler SelectedItemChanging
Occurs when the content of the SelectedItems collection has changed due to items being added or removed from the selection.
public event EventHandler SelectedItemsChanged
Occurs when a validation error is encountered during an edit operation or data binding.
public event EventHandler ValidationError
Occurs when the ViewType of the RadListView has changed to a different view mode such as ListView or DetailsView.
public virtual event EventHandler ViewTypeChanged
Occurs when the ViewType of the RadListView is about to change to a different view mode. This event is cancelable.
public virtual event ViewTypeChangingEventHandler ViewTypeChanging
Occurs when a new BaseListViewVisualItem needs to be created for visual representation of data items.
public event ListViewVisualItemCreatingEventHandler VisualItemCreating
Occurs when a ListViewDataItem changes its visual state and requires custom formatting to be applied.
public event ListViewVisualItemEventHandler VisualItemFormatting