ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / FeatureLayer Class / GetCanSetFeatureDrawOrder Method / GetCanSetFeatureDrawOrder(List<CIMFeatureSortInfo>) Method
The feature sort info to use for drawing order. Can be null
Example

In This Topic
    GetCanSetFeatureDrawOrder(List<CIMFeatureSortInfo>) Method
    In This Topic
    Gets whether or not the given feature draw order can be set on the layer. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Overloads Function GetCanSetFeatureDrawOrder( _
       ByVal drawingOrder As List(Of CIMFeatureSortInfo) _
    ) As Boolean
    public bool GetCanSetFeatureDrawOrder( 
       List<CIMFeatureSortInfo> drawingOrder
    )

    Parameters

    drawingOrder
    The feature sort info to use for drawing order. Can be null

    Return Value

    True if the drawingOrder can be used, false otherwise.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    Each ArcGIS.Core.CIM.CIMFeatureSortInfo specifies the name of a field in the layer and its sort order. A null or empty drawingOrder list is considered valid. A null or empty drawingOrder will clear the existing drawing order on the layer - see SetFeatureDrawOrder(List<CIMFeatureSortInfo>). Each field in each individual 'CIMFeatureSortInfo' entry must exist in the layer. A null or empty ArcGIS.Core.CIM.CIMFeatureSortInfo.FieldName will be considered invalid - use an empty or null list/> of 'CIMFeatureSortInfo' to clear the existing drawing order, _not_ a null field name in a CIMFeatureSortInfo entry.
    Any text, date, or numeric field can be used for draw order. Specifically, the following field types are not supported:
    Geometry/Shape, Blob, Raster, Guid, Global id, and Xml
    Example
    Set Feature Drawing Order 2
    {
        //Within QueuedTask.Run()
        if (featureLayer.GetIsFeatureDrawOrderSupported())
        {
            var listOfSortInfo = new List<CIMFeatureSortInfo>
            {
                //Draw features in the layer ordered by Police_Precinct field in ascending order
                //and then by Crime_rate field in descending order
                new CIMFeatureSortInfo
                {
                    FieldName = "Police_Precinct",
                    SortDirection = SortOrderType.Ascending
                },
                new CIMFeatureSortInfo
                {
                    FieldName = "Crime_rate",
                    SortDirection = SortOrderType.Descending
                }
            };
            //Provide the list of FSOs to use and their sort ordering
            //All fields must exist on the layer.
            if (featureLayer.GetCanSetFeatureDrawOrder(listOfSortInfo))
            {
                //Set the FDO to use the list of FSOs
                featureLayer.SetFeatureDrawOrder(listOfSortInfo);
            }
        }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.6 or higher.
    See Also