Proprietà TableFieldIndices

Restituisce gli indici nell'insieme AllFields dei campi specificati nella proprietà TableFields. Il valore predefinito è null.

public int[] TableFieldIndices {
   get
}

Osservazioni

Il valore è di sola lettura e dipende dall'impostazione della proprietà TableFields. Se la proprietà TableFields è vuota, viene restituito il valore null.

Esempio

Nell'esempio che segue viene illustrato come utilizzare la proprietà TableFieldIndices per visualizzare l'elemento Title del primo campo in ObjectList.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

ObjectList1.TableFields = "TaskName;Editable"
ObjectList1.LabelField = "TaskName"

' Change the default rendering by setting the TableFields property.
' Mapping between default index and applied is done by 
' TableFieldIndices. This array returns proper index in 
' ObjectListFieldsCollection collection to point to a particular
' ObjectListField item.
Label1.Text = ObjectList1.AllFields(ObjectList1.TableFieldIndices(0)).Title

End Sub



[C#]

public void Page_Load(Object sender, EventArgs e)
{
   ObjectList1.TableFields = "BookName;InStock";
   ObjectList1.LabelField = "BookName";

   // Change the default rendering by setting the TableFields property.
   // Mapping between default index and applied is done by 
   // TableFieldIndices. This array returns proper index in 
   // ObjectListFieldsCollection collection to point to a particular
   // ObjectListField item.
   Label1.Text = 
      ObjectList1.AllFields[ObjectList1.TableFieldIndices[0]].Title;
}   

Vedere anche

Si applica a: classe ObjectList