New to Telerik UI for WinFormsStart a free 30-day trial

Represents a data item in RadListView that can be bound to data sources or used in unbound mode. This class provides functionality for displaying text, images, styled appearance, grouping support, and state management including selection, enablement, visibility, and check states. Implements data binding interfaces for notifications and supports both simple and complex display scenarios.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
[TypeConverter(typeof(ListViewDataItemTypeConverter))]
public class ListViewDataItem : IDataItem, INotifyPropertyChanged, INotifyPropertyChangingEx, IDisposable

Inheritance: objectListViewDataItem

Derived Classes: DiagramListViewDataItemListViewDataItemGroup

Implements: IDataItemIDisposableINotifyPropertyChangedINotifyPropertyChangingEx

Constructors

Initializes a new instance of the ListViewDataItem class with default settings. Creates a new details cache, and sets the item to be visible and enabled by default.

C#
public ListViewDataItem()

Initializes a new instance of the ListViewDataItem class with the specified value object.

C#
public ListViewDataItem(object value)
Parameters:valueobject

The value object to associate with this data item.

Initializes a new instance of the ListViewDataItem class with the specified text and sub-item values.

C#
public ListViewDataItem(string text, string[] values)
Parameters:textstring

The main text to display for this data item.

valuesstring[]

An array of string values to add as sub-items for details view columns.

Initializes a new instance of the ListViewDataItem class with the specified text value.

C#
public ListViewDataItem(string text)
Parameters:textstring

The text to display for this data item.

Fields

C#
protected BitVector32 bitState
C#
protected const int IsCurrentState = 16
C#
protected const int IsEnabledState = 2
C#
protected const int IsLastInRowState = 8
C#
protected const int IsMeasureValidState = 32
C#
protected const int IsSelectedState = 1
C#
protected const int IsVisibleState = 4
C#
protected const int MajorBitState = 32

Properties

Gets the actual measured size of this data item as calculated during the layout process. This read-only property reflects the final size assigned to the item after considering constraints, content, and sizing preferences.

C#
[Browsable(false)]
public Size ActualSize { get; }

Gets or sets the primary background color of this list view item. This is the first color used in gradient effects and the solid background color when gradients are disabled. Supports ARGB color values for transparency effects.

C#
[Browsable(true)]
public Color BackColor { get; set; }

Gets or sets the secondary background color for gradient effects. This color is used in radial, glass, office glass, gel, and vista gradients to create color transitions from BackColor to this color.

C#
[Browsable(true)]
public Color BackColor2 { get; set; }

Gets or sets the third background color for advanced gradient effects. This color is used in radial, glass, office glass, and vista gradients when NumberOfColors is set to 3 or higher.

C#
[Browsable(true)]
public Color BackColor3 { get; set; }

Gets or sets the fourth background color for complex gradient effects. This color is used in radial, glass, office glass, and vista gradients when NumberOfColors is set to 4.

C#
[Browsable(true)]
public Color BackColor4 { get; set; }

Gets or sets the border color for this list view item. This property defines the color used to draw the item's border when border drawing is enabled in the visual style.

C#
[Browsable(true)]
public Color BorderColor { get; set; }

Gets or sets the check state of this item when checkboxes are enabled in the RadListView. In bound mode, the value is derived from the property specified by CheckedMember. Supports checked, unchecked, and indeterminate states.

C#
[Browsable(true)]
public virtual ToggleState CheckState { get; set; }

Gets or sets a value indicating whether this item is the current item in the RadListView. The current item typically receives focus and may have special visual styling to distinguish it from other items.

C#
[Browsable(false)]
public bool Current { get; }

Gets or sets the underlying data object that this list view item represents when in bound mode. This property provides access to the original data source object associated with this item.

C#
[Browsable(false)]
public object DataBoundItem { get; set; }
Property Value:

The data-bound object, or null if the item is not data-bound.

Implements: IDataItem.DataBoundItem

Gets or sets a value indicating whether this item responds to user interaction. When false, the item appears disabled and does not respond to mouse clicks, keyboard input, or other user interface events.

C#
[Browsable(true)]
public bool Enabled { get; set; }

Gets the number of fields available for this data item. In details view, returns the number of columns; in other views, returns 1 representing the main item value.

C#
[Browsable(false)]
public int FieldCount { get; }
Property Value:

The field count based on the current view type.

Implements: IDataItem.FieldCount

Gets or sets the font used to display the text for this list view item. When set, this overrides the default font inherited from the parent control and applies custom typography to this specific item.

C#
[Browsable(true)]
public Font Font { get; set; }

Gets or sets the foreground color used to display the text for this list view item. This property controls the color of the text content and overrides the default foreground color when set.

C#
[Browsable(true)]
public Color ForeColor { get; set; }

Gets or sets the angle in degrees for linear gradient effects. This property controls the direction of color transition in linear gradients, with 0 degrees representing horizontal and 90 degrees representing vertical gradients.

C#
public float GradientAngle { get; set; }

Gets or sets the gradient percentage for color transition effects. This property controls the position and intensity of gradient transitions in linear, glass, office glass, gel, vista, and radial gradients.

C#
public float GradientPercentage { get; set; }

Gets or sets the secondary gradient percentage for advanced gradient effects. This property provides additional control over color transition positioning in office glass, vista, and radial gradients.

C#
public float GradientPercentage2 { get; set; }

Gets or sets the gradient style used for background rendering. Available styles include solid, linear, radial, glass, office glass, gel, and vista gradients. Each style provides different visual effects for the item background.

C#
public GradientStyles GradientStyle { get; set; }

Gets or sets the group that contains this data item. When grouped view is enabled, items are organized under their assigned group headers. Setting this property to null removes the item from any existing group.

C#
[Browsable(true)]
public virtual ListViewDataItemGroup Group { get; set; }

Gets a value indicating whether this instance has custom style settings applied. When true, the item uses its own style properties instead of inheriting from the parent control's default styling.

C#
[Browsable(false)]
public bool HasStyle { get; }
Property Value:

True if custom style properties are defined; otherwise, false.

Gets or sets the image displayed for this list view item. If no direct image is set, the property attempts to retrieve an image from the control's ImageList using ImageIndex or ImageKey. Returns null if no image is found.

C#
[Browsable(true)]
public Image Image { get; set; }

Gets or sets the alignment of the image within this list view item. This property controls how the image is positioned within its allocated space, such as left, center, or right alignment.

C#
[Browsable(true)]
public ContentAlignment ImageAlignment { get; set; }

Gets or sets the index of the image from the control's ImageList to display for this item. A value of -1 indicates no image should be displayed. This property is overridden by ImageKey when both are set.

C#
[RelatedImageList("ListView.ImageList")]
[TypeConverter("Telerik.WinControls.UI.Design.NoneExcludedImageIndexConverter, Telerik.WinControls.UI.Design, Version=2026.2.702.48, Culture=neutral, PublicKeyToken=5bb2a467cbec794e")]
public virtual int ImageIndex { get; set; }

Gets or sets the key for the image associated with this list view item from the control's ImageList. When set, this property takes precedence over ImageIndex and the specified image will be displayed alongside the item text.

C#
[RelatedImageList("ListView.ImageList")]
[TypeConverter("Telerik.WinControls.UI.Design.RadImageKeyConverter, Telerik.WinControls.UI.Design, Version=2026.2.702.48, Culture=neutral, PublicKeyToken=5bb2a467cbec794e")]
public string ImageKey { get; set; }

Gets a value indicating whether this data item is bound to a data source. Returns true when the owning RadListView has a DataSource assigned.

C#
[Browsable(false)]
public virtual bool IsDataBound { get; }
Property Value:

True if the item is data-bound; otherwise, false.

Gets or sets the key object used by the RadListView FindItemByKey method for item lookup. This property provides a unique identifier for the data item within the list view. By default, this property holds a reference to the ListViewDataItem itself.

C#
[TypeConverter(typeof(StringConverter))]
public object Key { get; set; }

Gets the RadListView control that contains this data item. Returns null if the item is not currently associated with a list view control.

C#
[Browsable(false)]
public RadListView ListView { get; }
Property Value:

The parent RadListView control, or null if not assigned.

Gets or sets the number of colors used in gradient effects. This property determines how many of the background color properties (BackColor, BackColor2, BackColor3, BackColor4) are utilized in the gradient rendering.

C#
public int NumberOfColors { get; set; }

Gets the RadListViewElement that owns this data item. This provides access to the list view element's properties and methods for data binding, virtualization, and item management.

C#
[Browsable(false)]
public RadListViewElement Owner { get; }
Property Value:

The owning RadListViewElement instance.

Gets a value indicating whether this item is currently selected in the RadListView. Selected items are typically highlighted and included in the control's SelectedItems collection.

C#
[Browsable(false)]
public virtual bool Selected { get; }
Property Value:

True if the item is selected; otherwise, false.

Gets or sets the custom size for this data item. When set to a non-empty size, this overrides the default item sizing behavior and forces the item to use the specified dimensions. An empty size (0, 0) indicates automatic sizing should be used.

C#
[Browsable(true)]
public Size Size { get; set; }

Gets or sets the SVG image displayed for this list view item. SVG images provide scalable vector graphics support and can be rendered at different sizes while maintaining quality. This property works alongside the standard Image property.

C#
[Browsable(true)]
public RadSvgImage SvgImage { get; set; }

Gets or sets an object that contains user-defined data associated with this list view item. This property can be used to store any additional information needed by the application without affecting the item's display or behavior.

C#
[Bindable(true)]
[TypeConverter(typeof(StringConverter))]
public object Tag { get; set; }

Gets or sets the text displayed for this list view item. In bound mode, the text is derived from the property specified by DisplayMember or the item value itself. In unbound mode, it represents the string representation of the Value property.

C#
public virtual string Text { get; set; }

Gets or sets the alignment of the text content within this list view item. This property controls how the text is positioned within the item's bounds, such as left, center, or right alignment.

C#
[Browsable(true)]
public ContentAlignment TextAlignment { get; set; }

Gets or sets the spatial relationship between the image and text for this list view item. This property determines how the image is positioned relative to the text content, such as before, after, above, or below the text.

C#
[Browsable(true)]
public TextImageRelation TextImageRelation { get; set; }

Gets or sets the value for the field at the specified column index. If the column exists, returns the value for that column; otherwise, returns the main item value or manages sub-items collection.

C#
public object this[int index] { get; set; }
Parameters:indexint

The zero-based index of the column to get or set the value for.

Property Value:

The value for the specified column index or the main item value.

Implements: IDataItem.this[int]

Gets or sets the value for the specified column in details view. This indexer provides access to column-specific data using the column's accessor mechanism and manages sub-items when necessary.

C#
public object this[ListViewDetailColumn column] { get; set; }
Parameters:columnListViewDetailColumn

The ListViewDetailColumn to get or set the value for.

Property Value:

The value for the specified column.

Gets or sets the value for the field with the specified column name. If the column exists, returns the value for that column; otherwise, returns the main item value.

C#
public object this[string name] { get; set; }
Parameters:namestring

The name of the column to get or set the value for.

Property Value:

The value for the specified column or the main item value.

Implements: IDataItem.this[string]

Gets or sets the value for this data item. In bound mode, returns the property indicated by ValueMember; in unbound mode, returns the private value. Attempting to set this property in bound mode may result in an InvalidOperationException depending on the data source's capabilities.

C#
[Browsable(false)]
public virtual object Value { get; set; }

Gets or sets a value indicating whether this item is visible in the RadListView. When false, the item is hidden from view and excluded from layout calculations, but remains in the data collection.

C#
[Browsable(true)]
public bool Visible { get; set; }

Methods

Releases the resources used by this ListViewDataItem. This virtual method can be overridden in derived classes to provide custom cleanup logic.

C#
public virtual void Dispose()

Implements: IDisposable.Dispose()

Converts a data source value to a ToggleState for checkbox representation. Supports conversion from various types including bool, int, decimal, string, and CheckState values.

C#
protected virtual ToggleState FormatToggleStateDataSourceValue(object value)
Parameters:valueobject

The value from the data source to convert to a toggle state.

Returns:

ToggleState

The corresponding ToggleState representation of the value.

Converts a ToggleState value to the appropriate type for the target data field. Supports conversion to various target types including bool, int, decimal, CheckState, and custom types via type converters.

C#
protected virtual object FormatToggleStateValue(ToggleState value, PropertyDescriptor targetField)
Parameters:valueToggleState

The ToggleState value to convert.

targetFieldPropertyDescriptor

The property descriptor defining the target field type and conversion requirements.

Returns:

object

The converted value appropriate for the target field type, or null if conversion fails.

Retrieves the check state value from the bound data object using the CheckedMember property. Converts the bound value to the appropriate ToggleState representation.

C#
protected ToggleState GetBoundCheckedValue()
Returns:

ToggleState

The ToggleState derived from the bound checked property.

C#
protected virtual object GetBoundValue()
Returns:

object

Retrieves the display value for this item based on the DisplayMember property. If no display member is specified, returns the formatted representation of the entire data object.

C#
protected object GetDisplayValue()
Returns:

object

The formatted display value for this item.

Formats the specified value for display purposes. This virtual method can be overridden in derived classes to provide custom formatting logic for item values.

C#
protected virtual string GetFormattedValue(object value)
Parameters:valueobject

The value to format for display.

Returns:

string

The formatted string representation of the value.

Gets the value for the Value property when this item is in unbound mode. This virtual method can be overridden in derived classes to provide custom value retrieval logic.

C#
protected virtual object GetUnboundValue()
Returns:

object

The value object stored for this item in unbound mode.

Retrieves the value of the specified property from the bound data object. Supports both simple property names and complex property paths using dot notation for nested properties.

C#
protected object GetValue(string propertyName)
Parameters:propertyNamestring

The name or path of the property to retrieve from the data object.

Returns:

object

The value of the specified property, or the data object itself if retrieval fails.

Returns the zero-based index of the column with the specified name. If the column is not found, returns 0.

C#
public int IndexOf(string name)
Parameters:namestring

The name of the column to find the index for.

Returns:

int

The zero-based index of the column, or 0 if not found.

Implements: IDataItem.IndexOf(string)

Raises the PropertyChanged event with the specified event arguments. This virtual method handles special processing for certain properties and coordinates with the owning list view for state updates.

C#
protected virtual void OnNotifyPropertyChanged(PropertyChangedEventArgs args)
Parameters:argsPropertyChangedEventArgs

The PropertyChangedEventArgs containing information about the property change.

Raises the PropertyChanged event for the specified property name. This method provides a convenient overload for raising property change notifications with a string property name.

C#
protected void OnNotifyPropertyChanged(string propertyName)
Parameters:propertyNamestring

The name of the property that changed.

Raises the PropertyChanging event with the specified event arguments. This virtual method handles special validation for certain properties and allows event subscribers to cancel the property change.

C#
protected virtual bool OnNotifyPropertyChanging(PropertyChangingEventArgsEx args)
Parameters:argsPropertyChangingEventArgsEx

The PropertyChangingEventArgsEx containing information about the property change.

Returns:

bool

True if the property change should be cancelled; otherwise, false.

Raises the PropertyChanging event for the specified property name. This method provides a convenient overload for raising property changing notifications with a string property name.

C#
protected bool OnNotifyPropertyChanging(string propertyName)
Parameters:propertyNamestring

The name of the property that is about to change.

Returns:

bool

True if the property change should be cancelled; otherwise, false.

Sets the value for this item when in bound mode by updating the underlying data source. This method uses the ValueMember or DisplayMember property to determine which field to update in the bound data object.

C#
protected virtual void SetBoundValue(object value)
Parameters:valueobject

The new value to assign to the bound data property.

Associates this list view item with a data source object. This method is called during data binding operations and triggers the ItemDataBound event when appropriate.

C#
protected virtual void SetDataBoundItem(bool dataBinding, object value)
Parameters:dataBindingbool

Indicates whether this is part of a data binding operation.

valueobject

The data object to associate with this item.

Sets the value for the Value property when this item is in unbound mode. This virtual method handles property change notifications and owner updates when the value changes.

C#
protected virtual void SetUnboundValue(object value)
Parameters:valueobject

The new value to assign to this item.

Events

Occurs when a property value changes for this list view item. This event is part of the INotifyPropertyChanged interface implementation and enables data binding scenarios.

C#
public event PropertyChangedEventHandler PropertyChanged

Implements: INotifyPropertyChanged.PropertyChanged

Occurs when a property value is about to change for this list view item. This event allows cancellation of property changes and is part of the INotifyPropertyChangingEx interface implementation.

C#
public event PropertyChangingEventHandlerEx PropertyChanging

Implements: INotifyPropertyChangingEx.PropertyChanging