MailMergeDataSource
Provides the records and current-record navigation used to resolve fields during a mail merge.
Definition
Namespace:Telerik.WinForms.Documents.Model
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
public class MailMergeDataSource : RadObject, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor
Inheritance: objectDisposableObjectRadObjectMailMergeDataSource
Implements:
Inherited Members
Constructors
Creates a data source with no records.
public MailMergeDataSource()
Fields
Identifies the dependency property used to set the records from which mail-merge fields are read.
public static readonly RadProperty ItemsSourceProperty
Properties
Gets the record currently used to resolve mail-merge fields.
public object CurrentItem { get; }
Gets the current cursor position in the source record sequence.
public int CurrentItemIndex { get; }
Gets or sets the enumerable that supplies records for mail-merge field resolution. Changing the source updates the available field metadata and raises ItemsSourceChanged and CurrentItemChanged.
public IEnumerable ItemsSource { get; set; }
Methods
Gets the field names available on the source records, ordered by name.
public string[] GetColumnNames()
string[]
The names used to identify fields during mail merge.
Moves to the record at the specified zero-based position.
public bool MoveToIndex(int index)
The zero-based record position, -1 for before the first record, or the record count for after the last.
Returns:true when the position selects a record. On a newly constructed empty source, -1 also returns true although no record is selected; boundary positions on a non-empty source return false after normalization to the nearest record.
Exceptions: ArgumentOutOfRangeExceptionThe position is less than -1 or greater than the record count.
Moves to the previous record. If the move passes the beginning of a non-empty source, the current record is returned to the first record and the method returns false.
public bool MoveToPrevious()
false when moving before the first record is normalized back to that record. On a newly constructed empty source, this method returns true while CurrentItem remains null.
Events
Occurs when the record used to resolve mail-merge fields changes or when the source is assigned. Assigning a non-null source may raise this event twice.
public event EventHandler CurrentItemChanged
Occurs when the record sequence supplied by ItemsSource changes.
public event EventHandler ItemsSourceChanged