New to Telerik UI for WinForms? Start a free 30-day trial

Represents an item in a list control, including its display text, selection state, visual settings, and optional data value.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class RadListDataItem : RadObject, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, IDataItem

Inheritance: objectDisposableObjectRadObjectRadListDataItem

Derived Classes: CommandBarItemsListDataItemCommandBarStripsListDataItemDescriptionTextListDataItemRadCheckedListDataItem

Implements: ICustomTypeDescriptorIDataItemIDisposableINotifyPropertyChanged

Inherited Members RadObject.BindingContextPropertyRadObject.RadTypeRadObject.ReplaceDefaultDescriptors(PropertyDescriptorCollection)RadObject.DisposeManagedResources()RadObject.ClearPropertyStore()RadObject.SuspendPropertyNotifications()RadObject.ResumePropertyNotifications()RadObject.GetPropertyValue(RadProperty)RadObject.SetDefaultValueOverride(RadProperty, object)RadObject.GetValue(RadProperty)RadObject.SetValue(RadProperty, object)RadObject.ResetValue(RadProperty)RadObject.ResetLocalValue(RadProperty)RadObject.ResetValue(RadProperty, ValueResetFlags)RadObject.UpdateValue(RadProperty)RadObject.GetValueSource(RadProperty)RadObject.GetRegisteredRadProperty(string)RadObject.UpdateValueCore(RadPropertyValue)RadObject.SetValueCore(RadPropertyValue, object, object, ValueSource)RadObject.ResetValueCore(RadPropertyValue, ValueResetFlags)RadObject.GetDefaultValue(RadPropertyValue, object)RadObject.CoerceValue(RadPropertyValue, object)RadObject.ShouldSerializeProperty(RadProperty)RadObject.CanRaisePropertyChangeNotifications(RadPropertyValue)RadObject.BindProperty(RadProperty, RadObject, RadProperty, PropertyBindingOptions)RadObject.UnbindProperty(RadProperty)RadObject.AddStylePropertySetting(IPropertySetting)RadObject.GetInheritedValue(RadProperty)RadObject.OnPropertyChanging(RadPropertyChangingEventArgs)RadObject.OnNotifyPropertyChanged(string)RadObject.OnNotifyPropertyChanged(PropertyChangedEventArgs)RadObject.OnShouldSerializeProperty(ShouldSerializePropertyEventArgs)RadObject.IsPropertyCancelable(RadPropertyMetadata)RadObject.PropertyValuesRadObject.PropertyFilterRadObject.RadObjectTypeRadObject.BindingContextRadObject.PropertyChangedRadObject.RadPropertyChangedRadObject.RadPropertyChangingDisposableObject.GetBitState(long)DisposableObject.SetBitState(long, bool)DisposableObject.OnBitStateChanged(long, bool, bool)DisposableObject.Dispose()DisposableObject.Dispose(bool)DisposableObject.PerformDispose(bool)DisposableObject.DisposeUnmanagedResources()DisposableObject.BitStateDisposableObject.EventsDisposableObject.IsDisposingDisposableObject.IsDisposedDisposableObject.DisposedDisposableObject.Disposing...

Constructors

Initializes an item with default display and selection values.

C#
public RadListDataItem()

Initializes an item with display text and an unbound value.

C#
public RadListDataItem(string text, object value)
Parameters:textstring

The text shown for the item.

valueobject

The value returned by Value while the item is unbound.

Initializes an item with the specified display text.

C#
public RadListDataItem(string text)
Parameters:textstring

The text shown for the item.

Fields

Identifies the state that marks this item as the list's active item.

C#
public static readonly RadProperty ActiveProperty

The data layer used to retrieve bound values and refresh the item's cached display text.

C#
protected ListDataLayer dataLayer

Identifies the per-item height override used by the list layout.

C#
public static readonly RadProperty HeightProperty

The list element that owns this item and receives its property-change notifications.

C#
protected RadListElement ownerElement

Identifies whether this item is included in the list's selection.

C#
public static readonly RadProperty SelectedProperty

Identifies the value stored by an unbound item.

C#
public static readonly RadProperty ValueProperty

Properties

Gets or sets whether this item is the active item used for current list interaction and visual state.

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

Gets or sets the underlying object associated with this item when it is data bound. Assigning the property routes through SetDataBoundItem(bool, object); unlike Value, it is not rejected in bound mode.

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

Implements: IDataItem.DataBoundItem

The setter refreshes cached display text through the item's data layer, so the item must already have a data layer.

Gets a value that will be used in the visual representation of this item.

C#
[Browsable(false)]
public object DisplayValue { get; }

Gets or sets whether this item responds to GUI events.

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

Gets or sets the font for this RadListDataItem instance.

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

Gets or sets the text color for this RadListDataItem instance.

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

Gets or sets the item's height override. It is used when AutoSizeItems is false; when auto-sizing is enabled, the item is measured from its content instead.

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

Gets or sets an image for this RadListDataItem instance.

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

Gets or sets the image alignment for this RadListDataItem instance.

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

Gets the item's index in its owning list's RadListDataItemCollection; returns -1 when it has no owner.

C#
public virtual int Index { get; }
Property Value:

The index.

Gets a value indicating whether this data item is data bound.

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

Gets a value that indicates if this item is currently visible.

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

Gets or sets the preferred size for the element which will present this item.

C#
[Browsable(false)]
public SizeF MeasuredSize { get; set; }

Gets a value representing the owner RadListElement of this data item.

C#
[Browsable(false)]
public virtual RadListElement Owner { get; }

Gets a value representing the owner control of this data item.

C#
[Browsable(false)]
public Control OwnerControl { get; }

Gets the index of this data item in the Items collection of RadListControl.

C#
[Browsable(false)]
public int RowIndex { get; }

Gets or sets a value that indicates if this item is selected. Setting this property will cause the selection events of the owner list control to fire if there is one.

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

Gets or sets a vector image for this RadListDataItem instance.

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

Gets or sets arbitrary application data associated with the item, separate from its display text and bound data object.

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

Gets or sets the text for this RadListDataItem instance.

C#
[Browsable(true)]
public virtual string Text { get; set; }

Gets or sets the text alignment for this RadListDataItem instance.

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

Gets or sets the text-image relation for this RadListDataItem instance.

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

Gets or sets the text orientation for this RadListDataItem instance.

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

Gets or sets whether the item's text wraps within its available layout rectangle. The default is true.

C#
public bool TextWrap { get; set; }

Gets or sets a value for the property indicated by ValueMember if in bound mode, and private value in unbound mode. Trying to explicitly set this property in bound mode will result in an InvalidOperationException.

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

Gets a value that visually represents this data item. If the item is not visible, this property returns null. The visual item returned should be used only to get information about a particular item. Since visual items are shared between different data items, properties must not be set directly on the visual item in order to avoid uncustomizable or unwanted behavior. For example if properties are set directly to the visual item the themes may not work correctly.

C#
[Browsable(false)]
public RadListVisualItem VisualItem { get; }

Methods

Gets a value for the Value property while in bound mode.

C#
protected virtual object GetBoundValue()
Returns:

object

Gets an object reference pointing to the value of the Value property in bound mode.

Gets a value for the Value property in unbound mode.

C#
protected virtual object GetUnboundValue()
Returns:

object

Returns an object reference pointing to the value of the Value property in unbound mode.

Marks the item's measured size dirty and forwards property changes to the owner; text changes also refresh data-view ordering while preserving the selected item when possible.

C#
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters:eRadPropertyChangedEventArgs

The changed RadProperty and its old and new values.

Overrides: RadObject.OnPropertyChanged(RadPropertyChangedEventArgs)

Assigns the underlying data object and refreshes cached display text. When the item belongs to a bound list, the owner is notified. The current implementation does not reject calls based on the dataBinding value.

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

Indicates whether the assignment comes from the data-binding engine.

valueobject

The underlying data object to store.

This method is called when setting the Value property of a RadListDataItem when it is in unbound mode.

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

The value to set the Value property to.

Returns the item's current display text.

C#
public override string ToString()
Returns:

string

The text returned by Text.

Overrides: object.ToString()