Version

InitializeFrom(UltraListViewItem,Boolean) Method

Performs a memberwise copy of the specified UltraListViewItem instance to this instance.
Syntax
'Declaration
 
Protected Overloads Overridable Sub InitializeFrom( _
   ByVal source As UltraListViewItem, _
   ByVal includeSubItems As Boolean _
) 
protected virtual void InitializeFrom( 
   UltraListViewItem source,
   bool includeSubItems
)

Parameters

source
The UltraListViewItem instance from which this instance is to be initialized.
includeSubItems
Specifies whether the members of the source instance's SubItems collection are copied to this instance. Note that this parameter is only valid in the case where the source instance belongs to an Items collection.
Remarks

The value of the source instance's Group property is not copied to this instance.

The value of the source instance's Key property is copied to this instance, so if this instance is added to the same Items collection as the source instance, an duplicate key exception will be thrown. This can be prevented by changing the value of the Key property on this instance before adding it to a collection.

The value of the source instance's Index property, and its reference to the Items collection to which it belongs, if any, are not copied to this instance.

If the 'includeSubItems' parameter is set to true, each member of the source instance's SubItems collection is cloned and cached by the returned instance. At the time the returned instance is added to an Items collection, these cloned sub-items are added to its SubItems collection, in the same order in which they appeared in the source instance. If the number of SubItemColumns, or the structure of the SubItemColumns collection is different than that of the source instance, this may produce unexpected results. For example, if there exists three columns in the SubItemColumns collection of the source instance, 'A', 'B', and 'C', and two in that of the SubItemColumns collection of the control to which the returned instance is parented, 'A' and 'C', the sub-item which belonged to the 'B' column in the source instance's control will be added to the 'C' column of the returned instance's control. For most applications, cloning the SubItems collection is only useful in the case where the returned item is added to the same Items collection as that of the source instance, or where the SubItemColumns collections of both the source and target have the same structure.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, 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