移除特定欄位。
public void System.Web.UI.MobileControls.ObjectListField Remove(
System.Web.UI.MobileControls.ObjectListField field
)
參數
- field
要移除的欄位。
備註
IObjectListFieldCollection 介面中無法使用。
從物件清單的欄位移除欄位會改變控制項的資料繫結行為,並且您需要再次將資料繫結至控制項。
範例
下列範例示範如何使用 Remove 方法從 ObjectListFieldCollection 移除項目。
Sub CommandClick(sender as Object, e As ObjectListCommandEventArgs)
ObjectList1.Fields.Remove(ObjectList1.Fields(0))
'Associate array to ObjectList object.
ObjectList1.DataSource = Ctype(Session("MyArray"), ArrayList)
'Must bind data again.
ObjectList1.DataBind()
ObjectList1.ObjectListViewMode.List
End Sub
[C#]
void CommandClick(Object sender, ObjectListCommandEventArgs e)
{
ObjectList1.Fields.Remove(ObjectList1.Fields[0]);
// Associate array to ObjectList object.
ObjectList1.DataSource = (ArrayList) Session["MyArray"];
// Must bind data again.
ObjectList1.DataBind();
ObjectList1.ObjectListViewMode.List;
}
請參閱
Remove 方法 (DeviceSpecificChoiceCollection) | Remove 方法 (MobileListItemCollection) | Remove 方法 (ObjectListCommandCollection) | Remove 方法 (StyleSheet)