Version

OnAssigningFieldLayoutToItem Method

Occurs when an item from the DataSource is being associated with a FieldLayout that will define the layout of cells for this item within the DataPresenterBase.
Syntax
'Declaration
 
Protected Overridable Sub OnAssigningFieldLayoutToItem( _
   ByVal args As AssigningFieldLayoutToItemEventArgs _
) 
protected virtual void OnAssigningFieldLayoutToItem( 
   AssigningFieldLayoutToItemEventArgs args
)

Parameters

args
Remarks

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. This is done 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.

Requirements

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