Removes the specified System.Web.UI.Design.TemplateGroup object from the collection.
- group
- The System.Web.UI.Design.TemplateGroup to remove from the collection.
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.
When you remove an item from the collection, the indexes change for subsequent items in the collection.