Share via


AllFields Property

Returns the collection of all fields from the ObjectList class, whether explicit or automatically generated. The default value is the collection of automatically generated fields.

public System.Web.UI.MobileControls.IObjectListFieldCollection
   AllFields {
   get
}

Remarks

This collection is available only after data binding. Unlike the Fields collection, you cannot add or remove items in this collection. By default, this collection is the set of automatically generated fields. If any fields are explicitly defined, they are contained after any automatically generated fields.

Example

The following example demonstrates how to use the AllFields property to access all the fields of the ObjecList.

Protected Sub Cities_OnItemCommand(sender As Object, e As ObjectListCommandEventArgs)
   
     Dim m1(Objlist1.AllFields.Count) As ObjectListField 
     m1 = Objlist1.AllFields.GetAll() 
     Dim i As Integer 
     For i = 0 To Objlist1.AllFields.Count - 1 
         TextView1.Text += m1(i).DataField.ToString() + " : " + m1(i).Title + " 
   " Next i 

End Sub

[C#]
void List1_ItemCommand(Object sender, ObjectListSelectEventArgs e)
{ 
   ObjectListField[] m1 = new ObjectListField[Objlist1.AllFields.Count];
   m1 = Objlist1.AllFields.GetAll();
   for(int i=0; i<Objlist1.AllFields.Count; i++)
   {
     Txtvw.Text += m1[i].DataField.ToString() + " : "
       + m1[i].Title + " <br/>";
   }
}    

See Also

Applies to: ObjectList Class