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

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:

C#
public class MailMergeDataSource : RadObject, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor

Inheritance: objectDisposableObjectRadObjectMailMergeDataSource

Implements: ICustomTypeDescriptorIDisposableINotifyPropertyChanged

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.OnPropertyChanged(RadPropertyChangedEventArgs)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

Creates a data source with no records.

C#
public MailMergeDataSource()

Fields

Identifies the dependency property used to set the records from which mail-merge fields are read.

C#
public static readonly RadProperty ItemsSourceProperty

Properties

Gets the record currently used to resolve mail-merge fields.

C#
public object CurrentItem { get; }

Gets the current cursor position in the source record sequence.

C#
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.

C#
public IEnumerable ItemsSource { get; set; }

Methods

Gets the field names available on the source records, ordered by name.

C#
public string[] GetColumnNames()
Returns:

string[]

The names used to identify fields during mail merge.

Selects the first record in the source.

C#
public bool MoveToFirst()
Returns:

bool

true if a record is available; otherwise, false.

Moves to the record at the specified zero-based position.

C#
public bool MoveToIndex(int index)
Parameters:indexint

The zero-based record position, -1 for before the first record, or the record count for after the last.

Returns:

bool

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: ArgumentOutOfRangeException

The position is less than -1 or greater than the record count.

Selects the last record in the source.

C#
public bool MoveToLast()
Returns:

bool

true if a record is available; otherwise, false.

Advances to the next record. If the move passes the end of a non-empty source, the current record is returned to the last record and the method returns false.

C#
public bool MoveToNext()
Returns:

bool

true when the resulting position is within the source; otherwise, false.

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.

C#
public bool MoveToPrevious()
Returns:

bool

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.

C#
public event EventHandler CurrentItemChanged

Occurs when the record sequence supplied by ItemsSource changes.

C#
public event EventHandler ItemsSourceChanged