Share via


ObjectList.AllFields 屬性

定義

無論明確產生或自動產生,都從 ObjectList 類別傳回所有欄位的集合。 預設值是自動產生欄位的集合。 這個 API 已經過時。 如需如何開發 ASP.NET 行動應用程式的資訊,請參閱 具有 ASP.NET 的Mobile Apps & Sites

public:
 property System::Web::UI::MobileControls::IObjectListFieldCollection ^ AllFields { System::Web::UI::MobileControls::IObjectListFieldCollection ^ get(); };
[System.ComponentModel.Bindable(false)]
[System.ComponentModel.Browsable(false)]
public System.Web.UI.MobileControls.IObjectListFieldCollection AllFields { get; }
[<System.ComponentModel.Bindable(false)>]
[<System.ComponentModel.Browsable(false)>]
member this.AllFields : System.Web.UI.MobileControls.IObjectListFieldCollection
Public ReadOnly Property AllFields As IObjectListFieldCollection

屬性值

IObjectListFieldCollection 物件,包含 ObjectList 中的所有欄位。

屬性

範例

下列程式代碼範例示範如何使用 AllFields 屬性來列出 的所有欄位 ObjectList。 此範例是概觀較大範例的 ObjectList 一部分。

private void AllFields_Click(object sender, EventArgs e)
{
    ActiveForm = Form5;
    string spec = "{0}: {1}<br/>";
    IObjectListFieldCollection flds = List1.AllFields;
    for (int i = 0; i < flds.Count; i++)
        TextView1.Text += 
            String.Format(spec, (i + 1), flds[i].Title);
}
Private Sub AllFields_Click(ByVal sender As Object, ByVal e As EventArgs)

    ActiveForm = Form5
    Dim spec As String = "{0}: {1}<br/>"
    Dim flds As IObjectListFieldCollection = List1.AllFields
    Dim i As Integer
    For i = 0 To flds.Count - 1
        TextView1.Text += _
            String.Format(spec, (i + 1), flds(i).Title)
    Next
End Sub

備註

只有在數據系結之後,才能使用此集合。 Fields不同於集合,您無法新增或移除此集合中的專案。 根據預設,此集合是自動產生的欄位集。 如果明確定義任何欄位,它們就會包含在任何自動產生的欄位之後。

適用於

另請參閱