ObjectListItemCollection.Clear 方法

定义

清除集合。Clears the collection. 此 API 已废弃不用。This API is obsolete. 若要了解如何开发 ASP.NET 移动应用,请参阅 Mobile Apps & Sites with ASP.NET (ASP.NET 移动应用和网站)。For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

public:
 void Clear();
public void Clear ();
member this.Clear : unit -> unit
Public Sub Clear ()

注解

此方法在只读界面中不可用 IObjectListFieldCollectionThis method is not available in the read-only IObjectListFieldCollection interface.

Clear对于应用此方法的所有类,可以使用方法。You can use the Clear method for all the classes where this method applies. 例如,集合的 Clear 方法 StyleSheet 会清除集合中的所有样式; 对于 DeviceSpecificChoiceCollection ,它会清除集合中的所有选择。For example, the Clear method for a StyleSheet collection clears all the styles in the collection; or for the DeviceSpecificChoiceCollection, it clears all the choices in the collection.

将字段添加到对象列表的字段会更改控件的数据绑定行为,并要求您再次将数据绑定到控件。Adding a field to the fields of an object list changes the data-binding behavior of the control, and requires you to bind data to the control again.

适用于

另请参阅