---
title: Sorter(Of T)
summary: API reference for Sorter(Of T).
status: draft
owner: SAIF Documentation Team
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Controls.V2
reference_type: package
---

# Sorter(Of T)

`Sorter(Of T)` is a generic `IComparer(Of T)` implementation that sorts objects of any type by one or more property names supplied as a comma-separated string (with optional ` DESC`/` ASC` suffixes), using reflection to read each property's value at compare time. It is used by `SAIFTabBarTabCollection.Sort` to order `SAIFTabBarTab` entries.

## Purpose
- Provide a reusable, reflection-based multi-property sort comparer so `SAIFTabBarTabCollection` (and potentially other collections) can be sorted by named properties without hand-written comparison logic.

## Context
- Namespace: `SAIF.Presentation.Web.Controls.V2`
- Assembly/package: Compiled into `SAIF.BOF.Presentation.Web.Infragistics103`*

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `New()` | `Public Sub New()` | Constructs a sorter with no initial sort string (comparisons return `0` for all pairs until `SortString` is set). |
| `New(SortString)` | `Public Sub New(ByVal SortString As String)` | Constructs a sorter with an initial comma-separated list of property names to sort by. |
| `SortString` | `Public Property SortString As String` | The comma-separated list of property names (each optionally suffixed with ` DESC`/` ASC`) used to compare instances of `T`. |
| `Compare(x, y)` | `Public Function Compare(ByVal x As T, ByVal y As T) As Integer` | Compares two instances of `T` by iterating each property named in `SortString`, using reflection (`Type.GetProperty`) and `Comparer.DefaultInvariant`, returning the first non-zero comparison result. |

## Inherited public members

`Sorter(Of T)` does not inherit from a meaningful .NET Framework base class beyond `Object`; instead it implements `IComparer(Of T)` (`System.Collections.Generic`). Its public framework-shaped contract is the `Compare(x, y)` method already documented in the primary members table, so no additional inherited-members table is needed**.

## Behavioral notes
- Throws a `MissingFieldException` if a named property in `SortString` does not exist on type `T`.
- Reversal is per-property: appending ` DESC` to an individual property name in `SortString` reverses only that property's contribution to the comparison, not the whole sort.

## Constraints and usage notes
- Property names in `SortString` must exactly match public property names on `T` (case-sensitivity follows `Type.GetProperty`'s default behavior).


> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- SAIF.Presentation.Web.Controls.V2\SAIFTabBar.vb
