PropertyGridItem
Represents a property or nested member displayed as a row in the PropertyGrid.
The item's accessor supplies its property metadata and value; nested properties are exposed through GridItems.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class PropertyGridItem : PropertyGridItemBase, INotifyPropertyChanged, IDataItem, ITypeDescriptorContext, IServiceProvider
Inheritance: objectPropertyGridItemBasePropertyGridItem
Implements:
Inherited Members
Constructors
Creates an item associated with the specified table element and parent item.
public PropertyGridItem(PropertyGridTableElement propertyGridElement, PropertyGridItem parentItem)
The table element that owns the item.
parentItemPropertyGridItemThe parent item, or null for a root-level item.
Creates a root-level item associated with the specified table element.
public PropertyGridItem(PropertyGridTableElement propertyGridElement)
The table element that owns the item.
Fields
Cached value returned by Value when the owning table uses cached values.
protected object cachedValue
Properties
Gets the item accessor for this property item.
public IItemAccessor Accessor { get; }
Gets a collection of the attributes applied to the property.
public virtual AttributeCollection Attributes { get; }
Gets the category of the property from its CategoryAttribute or returns "Other" if no category is specified.
public virtual string Category { get; }
Gets the container of the control hosting this item, when the control has a site.
public IContainer Container { get; }
The host control's component container, or null if the item is not hosted by a sited control.
Implements:
Gets or sets the object stored in the DataBoundItem slot.
public object DataBoundItem { get; set; }
Implements:
Setting this property also replaces the item's accessor with a descriptor accessor created from the value when it is a PropertyDescriptor. Other value types leave that accessor without a descriptor.
Gets or sets whether the stored sort order is a grid-assigned default that may be replaced by a RadSortOrderAttribute value.
public bool DefaultSortOrder { get; set; }
When SortOrder is read while an accessor is available, the attribute is checked and this flag is cleared.
Gets or sets the description associated with this item.
public override string Description { get; set; }
Overrides:
Gets or sets an error message to be displayed when property value validation fails.
public virtual string ErrorMessage { get; set; }
Gets a value indicating whether this is a complex property.
public override bool Expandable { get; }
Overrides:
Gets the fixed field count reported to IDataItem consumers.
public int FieldCount { get; }
Always 8; this count is not derived from the public properties exposed by the indexers.
Implements:
Gets the value of the property as a string using its TypeConverter.
public virtual string FormattedValue { get; set; }
Gets the sub items of the current if it is composed of several sub-items.
public override PropertyGridItemCollection GridItems { get; }
Overrides:
Gets the object that owns this item's value, falling back to the parent item's instance when necessary.
public object Instance { get; }
Implements:
Gets a value indicating whether the property value is modified.
public virtual bool IsModified { get; }
Gets or sets a value defining whether check box editor will be three state.
public virtual bool IsThreeState { get; set; }
Gets or sets the text that would be displayed for this property.
public override string Label { get; set; }
Overrides:
Gets the original property value.
public virtual object OriginalValue { get; }
Gets or sets the parent of this item.
public override PropertyGridItemBase Parent { get; }
Overrides:
Gets the property descriptor for this property.
public virtual PropertyDescriptor PropertyDescriptor { get; }
Implements:
Gets the property type
public virtual Type PropertyType { get; }
Gets a value indicating whether the property is read only.
public virtual bool ReadOnly { get; }
Gets or sets a value defining the sort order of the item when no other sorting is applied.
public virtual int SortOrder { get; set; }
Gets the value of a public instance property by its reflection enumeration index.
public object this[int index] { get; set; }
The zero-based index in the public instance property list.
Property Value:The property value, or null when the index is greater than or equal to the property count.
Exceptions: IndexOutOfRangeExceptionThe index is negative.
Implements:
The setter does not assign a property value, and the index order is supplied by reflection.
Gets the value of a public instance property by name.
Gets the TypeConverter associated with this property
public virtual TypeConverter TypeConverter { get; }
Gets the UITypeEditor associated with this property
public virtual UITypeEditor UITypeEditor { get; }
Methods
Selects this item and puts the Property grid in edit mode.
public virtual void BeginEdit()
Gets the child items for a given item.
protected virtual PropertyGridItemCollection GetChildItems(PropertyGridItem parentItem, object obj, Type objType)
The parent item for which to get the child items.
objobjectThe instance of the item.
objTypeTypeThe type of the property.
Returns:Collection of PropertyGridItem
Resolves this item or one of its ancestors as a service.
public object GetService(Type serviceType)
The requested service type.
Returns:This item when serviceType is PropertyGridItem; otherwise, the first service returned by a parent, or null.
Implements:
Finds a public instance property by name in the same reflection order used by the integer indexer.
Does nothing; this context does not forward the change notification to an IComponentChangeService.
public void OnComponentChanged()
Implements:
Resets the property value to its default value.
public virtual void ResetValue()
Associates this item with its parent for hierarchy and value-owner resolution.
protected virtual void SetParent(PropertyGridItem parent)
The parent item, or null for a root-level item.
Determines if the item should update its child items based on the types of the old value and the new one.
Gets the default value of the current item. A return parameter determines if the operation succeeded.