InitializeRecord Event

Occurs when a Record is initialized
Public Event InitializeRecord As EventHandler(Of InitializeRecordEventArgs)
public event EventHandler<InitializeRecordEventArgs> InitializeRecord
Event Data

The event handler receives an argument of type InitializeRecordEventArgs containing data related to this event. The following InitializeRecordEventArgs properties provide information specific to this event.

Handled (Inherited from System.Windows.RoutedEventArgs)Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.
IsPreparingForSort Returns whether this record is being created and initialized in preparation for a sort operation (read-only)
OriginalSource (Inherited from System.Windows.RoutedEventArgs)Gets the original reporting source as determined by pure hit testing, before any possible System.Windows.RoutedEventArgs.Source adjustment by a parent class.
Record Returns the Record (read-only)
ReInitialize Indicates if the record is being re-initialized.
RoutedEvent (Inherited from System.Windows.RoutedEventArgs)Gets or sets the System.Windows.RoutedEventArgs.RoutedEvent associated with this System.Windows.RoutedEventArgs instance.
SortValueChanged Indicates whether the event was triggered as a result of a cell value change associated with a Field that is sorted. (read-only)
Source (Inherited from System.Windows.RoutedEventArgs)Gets or sets a reference to the object that raised the event.

Since Record is an abstract base class for DataRecord, GroupByRecord and ExpandableFieldRecord you may have to cast the Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs's Record property to the appropiate derived class to access specific properties, e.g. the DataRecord's DataRecord.Cells collection.

DataRecords are created lazily as each item in the DataSource is requested. When a DataRecord is created the FieldLayouts collection is searched for an existing FieldLayout whose FieldLayout.Fields match the DataRecord.DataItem's properties. If one is not found then a new FieldLayout is created, in which case the FieldLayoutInitializing and FieldLayoutInitialized events will be raised.

Note: If the new FieldLayout's FieldLayout.AutoGenerateFieldsResolved property returns true then the FieldLayout.Fields collection is automatically populated with a Field for every public property on the data item between the FieldLayoutInitializing and FieldLayoutInitialized events.

In any case the AssigningFieldLayoutToItem event is raised to allow a different FieldLayout to be assigned to the DataRecord. Finally the InitializeRecord event is raised.

For GroupByRecords and ExpandableFieldRecords this event is raised as the records are created.


Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also