SetIndex(Int32, IDataObject):Void

Re-sorts a data object in the collection.

This method sorts a data object to another position in the collection. Only data objects can be sorted which are already part of the collection.

If the alphabetical child sorting is set in the schema of the current data object, then an InvalidOperationException is triggered with the message "This collection is automatically sorted by alphabet."

Furthermore, the data object must, as already described, be a direct child of the current data object. Otherwise the exception DataObjectNotExistsException is triggered.

If a position is indicated for index that lies outside of the valid range, then an ArgumenOutOfRangeException is triggered

Return type: System.Void

Parameter

index

Type: System.Int32

This parameter is the new position for the data object in the collection.

dataObject

Type: Onion.Client.IDataObject

This parameter is the data object to be sorted to a new position in the collection. Data objects located underneath the data object to be moved remain child data objects of the data object.