Version

IndexOf(String,Nullable<Boolean>) Method

Gets the index of the FieldSortDescription for the specified field.
Syntax
'Declaration
 
Public Overloads Function IndexOf( _
   ByVal fieldName As String, _
   ByVal isGroupBy As Nullable(Of Boolean) _
) As Integer
public int IndexOf( 
   string fieldName,
   Nullable<bool> isGroupBy
)

Parameters

fieldName
The associated field
isGroupBy
If non-null will only return the index of a FieldSortDescription with the matching IsGroupBy value.

Return Value

The zero-based index or -1 if the field with the requested isGroupBy setting is not found
Remarks

Note: the collection can now contain up to 2 instances of FieldSortDescriptions with the same field (one with its IsGroupBy set to true and the other with its IsGroupBy set to false). This method will return the first instance that matches the field if the isGroupBy parameter is null. In the case where there are 2 instances it will always return the index of the one with its IsGroupBy set to true. This is because the collection is sorted such that all 'groupby' FieldSortDescriptions come before all 'non-groupby' ones.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also