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

# SAIFTabBarTabCollection

`SAIFTabBarTabCollection` is a serializable `List(Of SAIFTabBarTab)` that adds ID-based lookup and an `Order`/`Text`-based sort, used by `SAIFTabBar` to manage and render its tab collection in a consistent order.

## Purpose
- Provide `SAIFTabBar` with a typed, sortable, ID-searchable collection of tabs, avoiding ad-hoc LINQ/loop logic in the control itself.

## 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 an empty collection; tabs are added later by ASP.NET markup persistence (`ParseChildren`) rather than at construction time*. |
| `GetTabByID(TabID)` | `Public Function GetTabByID(ByVal TabID As String) As SAIFTabBarTab` | Returns the tab whose `ID` matches the given value, or `Nothing` if not found; used to resolve which tab a clicked `LinkButton` corresponds to. |
| `Sort(Direction)` | `Public Overloads Sub Sort(Optional ByVal Direction As SortOrder = SortOrder.Ascending) As Void` | Sorts the collection using a `Sorter(Of SAIFTabBarTab)` configured with `"Order,Text"`, ensuring tabs render in a predictable order. |

## Inherited public members

Members in this section are inherited from `List(Of SAIFTabBarTab)` in the .NET Framework (`System.Collections.Generic`), a framework base class rather than a documented SAIF dependency library.

| Member | Signature | Purpose |
| --- | --- | --- |
| `Add(item)` | `Public Sub Add(ByVal item As SAIFTabBarTab)` | Registers a new tab with the bar; ASP.NET markup parsing calls this once per declared `<saif:SAIFTabBarTab>` element to populate `Tabs`*. |
| `Remove(item)` | `Public Function Remove(ByVal item As SAIFTabBarTab) As Boolean` | Detaches a specific tab from the bar so it no longer renders or participates in selection/sort logic. |
| `RemoveAt(index)` | `Public Sub RemoveAt(ByVal index As Integer)` | Detaches the tab at a known position when the caller already has its index rather than the tab instance. |
| `Clear()` | `Public Sub Clear()` | Empties the tab bar of all tabs, e.g. before rebuilding the tab set programmatically. |
| `Contains(item)` | `Public Function Contains(ByVal item As SAIFTabBarTab) As Boolean` | Checks membership before attempting to add/remove a tab, avoiding duplicate entries. |
| `IndexOf(item)` | `Public Function IndexOf(ByVal item As SAIFTabBarTab) As Integer` | Locates a tab's position ahead of an index-based operation such as `Insert`/`RemoveAt`. |
| `Insert(index, item)` | `Public Sub Insert(ByVal index As Integer, ByVal item As SAIFTabBarTab)` | Adds a tab at a specific position, bypassing the `Order`/`Text` sort that `Sort()` would otherwise apply. |
| `Count` | `Public ReadOnly Property Count As Integer` | Reports how many tabs the bar currently manages, e.g. for `SAIFTabBar` to decide whether to render at all. |
| `Item(index)` | `Public Property Item(ByVal index As Integer) As SAIFTabBarTab` | Provides positional access to a tab, used by `CreateChildControls`/`RenderControl` when iterating the sorted collection. |
| `GetEnumerator()` | `Public Function GetEnumerator() As List(Of SAIFTabBarTab).Enumerator` | Supports `For Each` iteration over tabs, e.g. when `SAIFTabBar` applies bulk enable/disable/show/hide operations. |
| `ToArray()` | `Public Function ToArray() As SAIFTabBarTab()` | Produces a detached snapshot array of the current tabs for callers that need an array rather than a live collection reference. |

## Behavioral notes
- `Sort` always sorts by `"Order,Text"` regardless of the `Direction` parameter passed in — the parameter is accepted but not applied within `Sorter`'s comparison logic in this implementation*.

## Constraints and usage notes
- Because `Sort`'s `Direction` parameter has no observable effect (sort is always ascending by `Order`, then `Text`), callers should not rely on it to reverse tab ordering*.

> **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
