System.Web.UI.Design.TemplateGroupCollection.Remove Method

Removes the specified System.Web.UI.Design.TemplateGroup object from the collection.

Syntax

public void Remove (TemplateGroup group)

Parameters

group
The System.Web.UI.Design.TemplateGroup to remove from the collection.

Remarks

The TemplateGroupCollection.Remove(TemplateGroup) method removes the first occurrence of group from the collection. If the System.Web.UI.Design.TemplateGroupCollection object does not contain group, the collection remains unchanged. No exception is thrown.

The TemplateGroupCollection.Remove(TemplateGroup) method determines equality by using the object.Equals(object) method on the System.Web.UI.Design.TemplateGroup objects.

The TemplateGroupCollection.Remove(TemplateGroup) method performs a linear search; therefore, the average execution time is proportional to the TemplateGroupCollection.Count property. Because template group collections typically are small, the performance of the linear search operation is not critical.

To remove a group at a particular index from the collection, use the TemplateGroupCollection.RemoveAt(int) method. To remove all the groups from the collection, use the TemplateGroupCollection.Clear method.

Note:

When you remove an item from the collection, the indexes change for subsequent items in the collection.

Requirements

Namespace: System.Web.UI.Design
Assembly: System.Design (in System.Design.dll)
Assembly Versions: 2.0.0.0