ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data Namespace / SortDescription Class / CaseSensitivity Property
Example

In This Topic
    CaseSensitivity Property
    In This Topic
    Gets or sets the CaseSensitivity for the sort operation. This property is ignored for non-text field types. The default value is CaseSensitivity.Insensitive.
    Syntax
    public CaseSensitivity CaseSensitivity {get; set;}
    Public Property CaseSensitivity As CaseSensitivity
    Example
    Sorting a Table
    public RowCursor SortWorldCities(FeatureClass worldCitiesTable)
    {
        using (FeatureClassDefinition featureClassDefinition = worldCitiesTable.GetDefinition())
        {
            Field countryField = featureClassDefinition.GetFields()
              .First(x => x.Name.Equals("COUNTRY_NAME"));
            Field cityNameField = featureClassDefinition.GetFields()
              .First(x => x.Name.Equals("CITY_NAME"));
    
            // Create SortDescription for Country field
            SortDescription countrySortDescription = new SortDescription(countryField);
            countrySortDescription.CaseSensitivity = CaseSensitivity.Insensitive;
            countrySortDescription.SortOrder = SortOrder.Ascending;
    
            // Create SortDescription for City field
            SortDescription citySortDescription = new SortDescription(cityNameField);
            citySortDescription.CaseSensitivity = CaseSensitivity.Insensitive;
            citySortDescription.SortOrder = SortOrder.Ascending;
    
            // Create our TableSortDescription
            TableSortDescription tableSortDescription = new TableSortDescription(
              new List<SortDescription>() { countrySortDescription, citySortDescription });
    
            return worldCitiesTable.Sort(tableSortDescription);
        }
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also