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

# SAIFPanel

`SAIFPanel` is a `Panel` subclass providing a collapsible content panel with a header, title, and expand/collapse image, persisting its collapse state via `ViewState`/a hidden field so it survives postbacks and drives which client-side collapse-expand image and content `display` style render on each pass.

## Purpose
- Give consuming pages a reusable collapsible-section UI convention (header + collapse/expand toggle + content region) instead of hand-building panel chrome.
- Persist and restore expand/collapse state across postbacks via the posted `StateControl` hidden-field value, per [Collapsible panel state toggle](../../operations/collapsible-panel-state-toggle.md).

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

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `Collapseable` | `Public Property Collapseable As Boolean` | Enables collapse/expand behavior (header image, hidden state field, client script); when `False`, the panel renders without toggle chrome. Defaults to `True`. |
| `CollapseImageURL` | `Public Property CollapseImageURL As String` | Image shown when the panel is expanded (clicking it collapses the panel); defaults to `/Resources/Images/Up.png`. |
| `Content` | `Public Property Content As Panel` | The inner `Panel` control hosting the panel's body content; consumers add their controls to this panel (declared as the control's persisted inner content). |
| `ExpandImageURL` | `Public Property ExpandImageURL As String` | Image shown when the panel is collapsed (clicking it expands the panel); defaults to `/Resources/Images/Down.png`. |
| `PanelState` | `Public Property PanelState As PanelState` | The current expand/collapse state, driving the content `display` style and collapse/expand image on render. |
| `Title` | `Public Property Title As String` | Header text displayed for the panel; defaults to the control's `ID`. |
| `IsCollapsed` | `Public ReadOnly Property IsCollapsed As Boolean` | Convenience read-only check for `PanelState = PanelState.Collapsed`. |
| `IsExpanded` | `Public ReadOnly Property IsExpanded As Boolean` | Convenience read-only check for `PanelState = PanelState.Expanded`. |
| `New()` | `Public Sub New()` | Sets the base `CssClass` to `"SAIFPanel"`. |

## Inherited public members

`SAIFPanel` inherits from `Panel` (`System.Web.UI.WebControls`), a framework base class rather than a documented SAIF dependency library.

| Member | Signature | Purpose |
| --- | --- | --- |
| `Attributes` | `Public ReadOnly Property Attributes As AttributeCollection` | Collection of arbitrary HTML attributes rendered on the panel's outer tag. |
| `BackImageUrl` | `Public Property BackImageUrl As String` | Background image URL rendered on the panel when configured. |
| `CssClass` | `Public Property CssClass As String` | CSS class name(s) rendered on the panel's outer tag. |
| `DefaultButton` | `Public Property DefaultButton As String` | ID of the button triggered when the user presses Enter within the panel. |
| `Direction` | `Public Property Direction As ContentDirection` | Text/layout direction applied to the panel's contents. |
| `GroupingText` | `Public Property GroupingText As String` | Caption text rendered when the panel is configured as a fieldset. |
| `HorizontalAlign` | `Public Property HorizontalAlign As HorizontalAlign` | Horizontal alignment applied to content rendered within the panel. |
| `ScrollBars` | `Public Property ScrollBars As ScrollBars` | Scrollbar behavior used when panel content exceeds the rendered bounds. |
| `Style` | `Public ReadOnly Property Style As CssStyleCollection` | Inline CSS style declarations rendered on the outer tag. |
| `Wrap` | `Public Property Wrap As Boolean` | Controls whether text content wraps within the rendered panel. |

Standard `Panel`/`Control` members (`ID`, `ClientID`, `Controls`, `Visible`, `DataBind`, `FindControl`, etc.) are not re-documented here as they are unmodified framework behavior**.

## Behavioral notes
- `SAIFPanel_Init` restores `_PanelState` from the posted `HttpContext.Current.Request(UniqueID & "$StateControl")` value, if present, per [Collapsible panel state toggle](../../operations/collapsible-panel-state-toggle.md).
- `CreateChildControls` builds the Header/Title/collapse-expand image/hidden state field/Content tree, applying the current `_PanelState` to the initial inline `display` style and image URL.
- `SAIFPanel_PreRender` re-syncs the collapse/expand image and hidden field to the current `_PanelState` immediately before rendering.
- Actual client-side collapse/expand animation is driven by `Panel.js` (not present in this project); server logic only persists and reflects state, it does not perform the visual transition itself*.

## Constraints and usage notes
- Requires `Panel.js` to be deployed at `/Resources/Scripts/Controls/Panel.js` for interactive collapse/expand behavior.
- `Content` must be populated (typically via markup persistence, `ParseChildren(True, "Content")`) for the panel to have body content to show/hide.

> **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\SAIFPanel.vb
