Class RadListControl
This class represents data in a list layout similar to the ListBox control provided by Microsoft.
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
[TelerikToolboxCategory("Data Controls")]
[ClassInterface(ClassInterfaceType.AutoDispatch)]
[ComVisible(true)]
public class RadListControl : RadControl, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IPCHost, IAnalyticsProvider, ISupportRootUIAutomation
Constructors
RadListControl()
Declaration
public RadListControl()
Fields
CreatingVisualListItemEventKey
Declaration
public static readonly object CreatingVisualListItemEventKey
Field Value
System.Object
|
ListItemDataBindingEventKey
Declaration
public static readonly object ListItemDataBindingEventKey
Field Value
System.Object
|
ListItemDataBoundEventKey
Declaration
public static readonly object ListItemDataBoundEventKey
Field Value
System.Object
|
SelectedIndexChangedEventKey
Declaration
public static readonly object SelectedIndexChangedEventKey
Field Value
System.Object
|
SelectedIndexChangingEventKey
Declaration
public static readonly object SelectedIndexChangingEventKey
Field Value
System.Object
|
SelectedValueChangedEventKey
Declaration
public static readonly object SelectedValueChangedEventKey
Field Value
System.Object
|
SortStyleChangedEventKey
Declaration
public static readonly object SortStyleChangedEventKey
Field Value
System.Object
|
VisualItemFormattingEventKey
Declaration
public static readonly object VisualItemFormattingEventKey
Field Value
System.Object
|
Properties
ActiveItem
Gets or sets the active item. The Active item is relevant only in MultiSimple SelectionMode or MultiExtended in combination with the control keyboard key.
Declaration
public RadListDataItem ActiveItem { get; set; }
Property Value
RadListDataItem
|
AllowDragDrop
Gets or sets value indicating if the user can reorder items via drag and drop.
Declaration
public bool AllowDragDrop { get; set; }
Property Value
System.Boolean
|
AutoSizeItems
Gets or sets a value that indicates whether items will be sized according to their content. If this property is true the user can set the Height property of each individual RadListDataItem in the Items collection in order to override the automatic sizing.
Declaration
public bool AutoSizeItems { get; set; }
Property Value
System.Boolean
|
BackColor
RadListControl consists of multiple visual elements and separate settings are provided to customize their appearance. Current BackColor property might be ignored.
Declaration
public override Color BackColor { get; set; }
Property Value
System.Drawing.Color
|
Overrides
CaseSensitiveSort
Gets or sets a value that indicates whether text case will be taken into account when sorting.
Declaration
public bool CaseSensitiveSort { get; set; }
Property Value
System.Boolean
|
DataMember
Declaration
public string DataMember { get; set; }
Property Value
System.String
|
DataSource
Gets or sets an object which will provide the data to be visualized as a list.
Declaration
public object DataSource { get; set; }
Property Value
System.Object
|
DefaultSize
Declaration
protected override Size DefaultSize { get; }
Property Value
System.Drawing.Size
|
DescriptionTextMember
Gets or sets a property name which will be used to extract a text for description text from the data items. The value of the property with this name will be available via the Value property of every RadListDataItem in the Items collection.
Declaration
public string DescriptionTextMember { get; set; }
Property Value
System.String
|
DisplayMember
Gets or sets a property name which will be used to extract a string value from the data items in order to provide a meaningful display value.
Declaration
public string DisplayMember { get; set; }
Property Value
System.String
|
EnableAlternatingItemColor
Gets or sets a value indicating whether alternating item color is enabled.
Declaration
public virtual bool EnableAlternatingItemColor { get; set; }
Property Value
System.Boolean
|
EnableKineticScrolling
Gets or sets a value indicating whether the kinetic scrolling function is enabled.
Declaration
public bool EnableKineticScrolling { get; set; }
Property Value
System.Boolean
|
EnableUIAutomation
Gets or sets a value indicating whether the UI Automation functionality is enabled or disabled for this control.
Declaration
public virtual bool EnableUIAutomation { get; set; }
Property Value
System.Boolean
|
Implements
Filter
Gets or sets a predicate which filters which items can be visible.
Declaration
public Predicate<RadListDataItem> Filter { get; set; }
Property Value
System.Predicate<RadListDataItem>
|
FilterExpression
Gets or sets a filter expression which determines which items will be visible.
Declaration
public string FilterExpression { get; set; }
Property Value
System.String
|
FindStringComparer
Gets or sets an object that implements IFindStringComparer. The value of this property is used in the FindString() method when searching for an item.
Declaration
public IFindStringComparer FindStringComparer { get; set; }
Property Value
IFindStringComparer
|
FitItemsToSize
Declaration
public bool FitItemsToSize { get; set; }
Property Value
System.Boolean
|
ForeColor
RadListControl consists of multiple visual elements and separate settings are provided to customize their appearance. Current ForeColor property might be ignored.
Declaration
public override Color ForeColor { get; set; }
Property Value
System.Drawing.Color
|
Overrides
FormatString
Gets or sets a format string which will be used for visual formatting of the items text.
Declaration
public string FormatString { get; set; }
Property Value
System.String
|
FormattingEnabled
Gets or sets a value that indicates whether the FormatString and FormatInfo properties will be used to format the items text. Setting this property to false may improve performance.
Declaration
public bool FormattingEnabled { get; set; }
Property Value
System.Boolean
|
IsFilterActive
Gets a value indicating whether there is a Filter or FilterExpression set.
Declaration
public bool IsFilterActive { get; }
Property Value
System.Boolean
|
ItemHeight
Declaration
public int ItemHeight { get; set; }
Property Value
System.Int32
|
Items
Gets the Items collection. Items can not be modified in data bound mode, and a DataSource can not be assigned while there are items in this collection.
Declaration
public RadListDataItemCollection Items { get; }
Property Value
RadListDataItemCollection
|
ItemTextComparisonMode
Gets or sets a value that determines whether the FindString() method searches via the text property set by the user or by the text provided by the data binding logic, that is, by DisplayMember.
Declaration
public ItemTextComparisonMode ItemTextComparisonMode { get; set; }
Property Value
ItemTextComparisonMode
|
KeyboardSearchEnabled
Gets or sets a value that determines whether the user can search for an item by typing characters when RadListControl is focused.
Declaration
public bool KeyboardSearchEnabled { get; set; }
Property Value
System.Boolean
|
KeyboardSearchResetInterval
Gets or sets a value that specifies how long the user must wait before searching with the keyboard is reset.
Declaration
public int KeyboardSearchResetInterval { get; set; }
Property Value
System.Int32
|
ListElement
The ListElement responsible for the majority of the control logic. The RadListControl is a wrapper of the RadListElement.
Declaration
public RadListElement ListElement { get; set; }
Property Value
RadListElement
|
ScrollMode
Gets or set the scroll mode.
Declaration
public ItemScrollerScrollModes ScrollMode { get; set; }
Property Value
ItemScrollerScrollModes
|
SelectedIndex
Gets or sets the currently selected index.
Declaration
public int SelectedIndex { get; set; }
Property Value
System.Int32
|
SelectedItem
Gets or sets the currently selected item.
Declaration
public RadListDataItem SelectedItem { get; set; }
Property Value
RadListDataItem
|
SelectedItems
Provides a read only interface to the selected items. In order to select an item, use its Selected property.
Declaration
public IReadOnlyCollection<RadListDataItem> SelectedItems { get; }
Property Value
IReadOnlyCollection<RadListDataItem>
|
SelectedValue
Gets or sets the SelectedValue. A linear search is performed to find a data item that has the same value in its Value property and SelectedItem and SelectedIndex are updated to it and its index respectively.
Declaration
public object SelectedValue { get; set; }
Property Value
System.Object
|
SelectionMode
Gets or sets the SelectionMode of RadListControl. This property has a similar effect to the SelectionMode of the standard Microsoft ListBox control.
Declaration
public SelectionMode SelectionMode { get; set; }
Property Value
System.Windows.Forms.SelectionMode
|
SortStyle
Gets or sets the sort style.
Declaration
public SortStyle SortStyle { get; set; }
Property Value
SortStyle
|
SuspendItemsChangeEvents
Gets or sets a value that indicates if this RadListControl will stop firing the ItemsChanging and ItemsChanged events.
Declaration
public bool SuspendItemsChangeEvents { get; set; }
Property Value
System.Boolean
|
SuspendSelectionEvents
Gets or sets a value that determines whether to stop the selection events from firing. These are SelectedIndexChanged, SelectedIndexChanging and SelectedValueChanged.
Declaration
public bool SuspendSelectionEvents { get; set; }
Property Value
System.Boolean
|
Text
This property is not relevant for this class.
Declaration
public override string Text { get; set; }
Property Value
System.String
|
Overrides
ValueMember
Gets or sets a property name which will be used to extract a value from the data items. The value of the property with this name will be available via the Value property of every RadListDataItem in the Items collection.
Declaration
public string ValueMember { get; set; }
Property Value
System.String
|
Methods
BeginUpdate()
Suspends internal notifications and processing in order to improve performance. This method is cumulative, that is, if BeginUpdate is called N times, EndUpdate must also be called N times. Calling BeginUpdate will cause the ItemsChanged event to stop firing until EndUpdate is called.
Declaration
public void BeginUpdate()
CanEditElementAtDesignTime(RadElement)
Declaration
protected override bool CanEditElementAtDesignTime(RadElement element)
Parameters
RadElement
element
|
Returns
System.Boolean
|
Overrides
ClearMeasuredSize()
Declaration
protected virtual void ClearMeasuredSize()
CreateAccessibilityInstance()
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
System.Windows.Forms.AccessibleObject
|
CreateChildItems(RadElement)
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
RadElement
parent
|
Overrides
CreateListElement()
DeferRefresh()
Defers the refresh.
Declaration
public virtual IDisposable DeferRefresh()
Returns
System.IDisposable
|
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
System.Boolean
disposing
|
Overrides
EndInit()
EndUpdate()
Resumes the internal notifications and processing previously suspended by BeginUpdate.
Declaration
public void EndUpdate()
FindItemExact(String, Boolean)
Declaration
public RadListDataItem FindItemExact(string text, bool caseSensitive)
Parameters
System.String
text
|
System.Boolean
caseSensitive
|
Returns
RadListDataItem
|
FindString(String)
Searches for an item related to the specified string. The relation is described by the object assigned to FindStringComparer property. By default this relation is the System.String.StartsWith(). This method starts searching from the beginning of the items.
Declaration
public int FindString(string s)
Parameters
System.String
s
The string with which every item will be compared. |
Returns
System.Int32
The index of the found item or -1 if no item is found. |
FindString(String, Int32)
Searches for an item related to the specified string. The relation is described by the object assigned to FindStringComparer property. By default this relation is the System.String.StartsWith(). This method starts searching from the specified index. If the algorithm reaches the end of the Items collection it wraps to the beginning and continues until one before the provided index.
Declaration
public int FindString(string s, int startIndex)
Parameters
System.String
s
The string with which every item will be compared. |
System.Int32
startIndex
The index from which to start searching. |
Returns
System.Int32
The index of the found item or -1 if no item is found. |
FindStringExact(String)
Searches for an item in the same manner as FindString() but matches an item only if its text is exactly equal to the provided string.
Declaration
public int FindStringExact(string s)
Parameters
System.String
s
|
Returns
System.Int32
|
FindStringExact(String, Int32)
Searches for an item in the same manner as FindString() but matches an item only if its text is exactly equal to the provided string.
Declaration
public int FindStringExact(string s, int startIndex)
Parameters
System.String
s
|
System.Int32
startIndex
|
Returns
System.Int32
|
FindStringNonWrapping(String)
Searches for an item in the same manner as FindString() but does not start from the beginning when the end of the Items collection is reached.
Declaration
public int FindStringNonWrapping(string s)
Parameters
System.String
s
The string that will be used to search for an item. |
Returns
System.Int32
The index of the found item or -1 if no item is found. |
FindStringNonWrapping(String, Int32)
Searches for an item in the same manner as FindString() but does not start from the beginning when the end of the Items collection is reached.
Declaration
public int FindStringNonWrapping(string s, int startIndex)
Parameters
System.String
s
The string that will be used to search for an item. |
System.Int32
startIndex
The index from which to start searching. |
Returns
System.Int32
The index of the found item or -1 if no item is found. |
HandleEndKey()
Declaration
protected virtual void HandleEndKey()
HandleHomeKey()
Declaration
protected virtual void HandleHomeKey()
HandlePageDownKey()
Declaration
protected virtual void HandlePageDownKey()
HandlePageUpKey()
Declaration
protected virtual void HandlePageUpKey()
IsInputChar(Char)
Declaration
protected override bool IsInputChar(char charCode)
Parameters
System.Char
charCode
|
Returns
System.Boolean
|
IsInputKey(Keys)
Declaration
protected override bool IsInputKey(Keys keyData)
Parameters
System.Windows.Forms.Keys
keyData
|
Returns
System.Boolean
|
Overrides
OnCreatingVisualItem(Object, CreatingVisualListItemEventArgs)
Declaration
protected virtual void OnCreatingVisualItem(object sender, CreatingVisualListItemEventArgs args)
Parameters
System.Object
sender
|
CreatingVisualListItemEventArgs
args
|
OnDataBindingComplete(Object, ListBindingCompleteEventArgs)
Raises the DataBindingComplete event.
Declaration
protected virtual void OnDataBindingComplete(object sender, ListBindingCompleteEventArgs e)
Parameters
System.Object
sender
|
ListBindingCompleteEventArgs
e
An ListBindingCompleteEventArgs instance that contains the event data. |
See Also
OnEnabledChanged(EventArgs)
Declaration
protected override void OnEnabledChanged(EventArgs e)
Parameters
System.EventArgs
e
|
Overrides
OnGotFocus(EventArgs)
Declaration
protected override void OnGotFocus(EventArgs e)
Parameters
System.EventArgs
e
|
Overrides
OnItemDataBinding(Object, ListItemDataBindingEventArgs)
Declaration
protected virtual void OnItemDataBinding(object sender, ListItemDataBindingEventArgs args)
Parameters
System.Object
sender
|
ListItemDataBindingEventArgs
args
|
OnItemDataBound(Object, ListItemDataBoundEventArgs)
Declaration
protected virtual void OnItemDataBound(object sender, ListItemDataBoundEventArgs args)
Parameters
System.Object
sender
|
ListItemDataBoundEventArgs
args
|
OnKeyDown(KeyEventArgs)
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
System.Windows.Forms.KeyEventArgs
e
|
Overrides
OnLoad(Size)
Declaration
protected override void OnLoad(Size desiredSize)
Parameters
System.Drawing.Size
desiredSize
|
Overrides
OnMouseDown(MouseEventArgs)
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnMouseMove(MouseEventArgs)
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnMouseUp(MouseEventArgs)
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnMouseWheel(MouseEventArgs)
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnSelectedIndexChanged(Object, Int32)
Declaration
protected virtual void OnSelectedIndexChanged(object sender, int newIndex)
Parameters
System.Object
sender
|
System.Int32
newIndex
|
OnSelectedIndexChanging(Object, Int32)
Declaration
protected virtual bool OnSelectedIndexChanging(object sender, int newIndex)
Parameters
System.Object
sender
|
System.Int32
newIndex
|
Returns
System.Boolean
|
OnSelectedValueChanged(Object, Int32, Object, Object)
Declaration
protected virtual void OnSelectedValueChanged(object sender, int newIndex, object newValue, object oldValue)
Parameters
System.Object
sender
|
System.Int32
newIndex
|
System.Object
newValue
|
System.Object
oldValue
|
OnSortStyleChanged(Object, SortStyleChangedEventArgs)
Declaration
protected virtual void OnSortStyleChanged(object sender, SortStyleChangedEventArgs args)
Parameters
System.Object
sender
|
SortStyleChangedEventArgs
args
|
OnVisualItemFormatting(Object, VisualItemFormattingEventArgs)
Declaration
protected virtual void OnVisualItemFormatting(object sender, VisualItemFormattingEventArgs args)
Parameters
System.Object
sender
|
VisualItemFormattingEventArgs
args
|
ProcessCodedUIMessage(ref IPCMessage)
Declaration
protected override void ProcessCodedUIMessage(ref IPCMessage request)
Parameters
IPCMessage
request
|
Overrides
Rebind()
Forces re-evaluation of the current data source (if any).
Declaration
public void Rebind()
ScrollByPage(Int32)
Declaration
public void ScrollByPage(int pageCount)
Parameters
System.Int32
pageCount
|
ScrollToItem(RadListDataItem)
Scrolls to the provided item so that the item will appear at the top of the view if it is before the currently visible items and at the bottom of the view if it is after the currently visible items.
Declaration
public void ScrollToItem(RadListDataItem item)
Parameters
RadListDataItem
item
The item to scroll to. |
SelectAll()
Selects all items if the SelectionMode allows it. This method throws an InvalidOperationException if SelectionMode is One or None.
Declaration
public void SelectAll()
SelectRange(Int32, Int32)
Clears the currently selected items and selects all items in the closed range [startIndex, endIndex].
Declaration
public void SelectRange(int startIndex, int endIndex)
Parameters
System.Int32
startIndex
The first index at which to start selecting items. |
System.Int32
endIndex
The index of one item past the last one to be selected. |
UnwireEvents()
Unsubscribes from the relevant events of the underlaying RadListElement.
Declaration
protected virtual void UnwireEvents()
WireEvents()
Subscribes to the relevant events of the underlaying RadListElement.
Declaration
protected virtual void WireEvents()
WndProc(ref Message)
Declaration
protected override void WndProc(ref Message m)
Parameters
System.Windows.Forms.Message
m
|
Overrides
Events
CreatingVisualListItem
This event allows the user to create custom visual items. It is fired initially for all the visible items and when the control is resized afterwards.
Declaration
public event CreatingVisualListItemEventHandler CreatingVisualListItem
Event Type
CreatingVisualListItemEventHandler
|
DataBindingComplete
Fires after data binding operation has finished.
Declaration
public event ListBindingCompleteEventHandler DataBindingComplete
Event Type
ListBindingCompleteEventHandler
|
See Also
ItemDataBinding
This event fires before a RadListDataItem is data bound. This happens when the DataSource property is assigned and the event fires for every item provided by the data source. This event allows a custom RadListDataItem to be provided by the user.
Declaration
public event ListItemDataBindingEventHandler ItemDataBinding
Event Type
ListItemDataBindingEventHandler
|
ItemDataBound
This event fires after a RadListDataItem is data bound. This happens when the DataSource property is assigned and the event is fired for every item provided by the data source.
Declaration
public event ListItemDataBoundEventHandler ItemDataBound
Event Type
ListItemDataBoundEventHandler
|
SelectedIndexChanged
This event fires when the selected index property changes.
Declaration
public event PositionChangedEventHandler SelectedIndexChanged
Event Type
PositionChangedEventHandler
|
SelectedIndexChanging
This event fires before SelectedIndex changes. This event allows the operation to be cancelled.
Declaration
public event PositionChangingEventHandler SelectedIndexChanging
Event Type
PositionChangingEventHandler
|
SelectedItemsChanged
This event fires when the SelectedItems collection changes.
Declaration
public event NotifyCollectionChangedEventHandler SelectedItemsChanged
Event Type
NotifyCollectionChangedEventHandler
|
SelectedItemsChanging
This event fires before the SelectedItems collection changes.
Declaration
public event NotifyCollectionChangingEventHandler SelectedItemsChanging
Event Type
NotifyCollectionChangingEventHandler
|
SelectedValueChanged
This event fires only if the SelectedValue has really changed. For example it will not fire if the previously selected item has the same value as the newly selected item.
Declaration
public event EventHandler SelectedValueChanged
Event Type
System.EventHandler
|
SortStyleChanged
This event fires when the SortStyle property changes.
Declaration
public event SortStyleChangedEventHandler SortStyleChanged
Event Type
SortStyleChangedEventHandler
|
VisualItemFormatting
The VisualItemFormatting event fires whenever a property of a visible data item changes and whenever a visual item is associated with a new data item. During scrolling for example.
Declaration
public event VisualListItemFormattingEventHandler VisualItemFormatting
Event Type
VisualListItemFormattingEventHandler
|
Explicit Interface Implementations
ISupportRootUIAutomation.InitializeUIAutomationProvider()
Creates the UI Automation provider for this control.
Declaration
void ISupportRootUIAutomation.InitializeUIAutomationProvider()
Implements
ISupportRootUIAutomation.RootUIAutomationManager
Gets the UI Automation Manager.
Declaration
IRootUIAutomationManager ISupportRootUIAutomation.RootUIAutomationManager { get; }
Returns
IRootUIAutomationManager
|
Implements
ISupportRootUIAutomation.UIAutomationProvider
Gets the UI Automation Provider.
Declaration
IRadRawElementProviderFragmentRoot ISupportRootUIAutomation.UIAutomationProvider { get; }
Returns
IRadRawElementProviderFragmentRoot
|