DataItemCollection
Stores mail-merge records, their available field names, and the current record position.
Definition
Namespace:Telerik.WinForms.Documents.Model
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
public class DataItemCollection : INotifyPropertyChanged
Inheritance: objectDataItemCollection
Implements:
Constructors
Creates an empty collection with no field metadata and an initial cursor position of -1.
public DataItemCollection()
Properties
Gets the record at the current cursor position, or null when the position is outside the collection.
public object CurrentItem { get; }
Gets or sets the cursor position. Navigation uses -1 for before the first record and Count for after the last; setting this property directly does not synchronize CurrentItem or raise notifications.
public int CurrentPosition { get; set; }
Gets or sets whether the cursor is positioned after the last record.
public bool IsCurrentAfterLast { get; set; }
Gets or sets whether the cursor is positioned before the first record.
public bool IsCurrentBeforeFirst { get; set; }
Gets the public CLR properties discovered on the source record type.
public ReadOnlyCollection<PropertyInfo> ItemProperties { get; }
Gets the field keys exposed for the source records. Dynamic member names are discovered only when the source records expose no public CLR properties.
public ReadOnlyCollection<string> ItemPropertyKeys { get; }
Methods
Moves to a record or to one of the boundary positions.
public bool MoveCurrentToPosition(int position)
The zero-based record position, -1 for before the first record, or Count for after the last.
Returns: Exceptions: ArgumentOutOfRangeExceptionposition is less than -1 or greater than Count.
Raises the CurrentChanged event.
protected virtual void OnCurrentChanged(EventArgs args)
The event data passed to handlers.
Raises the PropertyChanged event for the specified property.
protected virtual void OnPropertyChanged(string propertyName)
The name of the property that changed.
Assigns the current record and updates the before-first and after-last flags. This method does not raise change notifications.
protected void SetCurrent(object newItem, int newPosition)
The record to make current.
newPositionintThe cursor position to assign. When newItem is null and
the collection is empty, both boundary flags are set and the position is forced to -1.
Otherwise, a value before zero or at/after Count sets the corresponding boundary flag.
Events
Occurs when navigation changes the current record or cursor position, and when the source records are loaded into the collection.
public event EventHandler CurrentChanged
Occurs when navigation changes CurrentItem, CurrentPosition, IsCurrentBeforeFirst, or IsCurrentAfterLast.
public event PropertyChangedEventHandler PropertyChanged
Implements: