Skip to main content
Version: 4.2

EmptyState

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.2.0.0)

Displays an illustration, explanation, and optional actions when a view has no content.

public class EmptyState : Control

Null Title and Description use localized Kind defaults. Empty strings suppress them. Actions raise application-owned requests without automatically changing the data.

Example:

var empty = new EmptyState {
Title = "No alerts in the last 24 hours", Bordered = true,
Description = "Rules fire here when a threshold is crossed.",
ActionText = "Configure rules", Dock = DockStyle.Fill
};
empty.ActionClick += (s, e) => ShowRuleEditor();
Controls.Add(empty);

Constructors​

Instance member EmptyState()​

Creates a placeholder whose action buttons participate in keyboard navigation.

Properties​

Instance member ActionText​

String: Gets or sets the primary action caption. Null or empty hides the action. (Default: null)

The default is null; there is no built-in action caption. Supply application text to display the action. Activating it raises ActionClick without changing the displayed state.

Instance member Bordered​

Boolean: Gets or sets whether the themed dashed outline is displayed. (Default: False)

Instance member Compact​

Boolean: Gets or sets whether a compact horizontal layout is used. (Default: False)

Protected member DefaultSize​

Size: Gets the default 420 by 220 pixel size.

Instance member Description​

String: Gets or sets the explanation. Null uses the localized Kind explanation; empty hides it. (Default: null)

The default is null. The built-in explanation is selected for Kind and the current UI culture when rendered. The getter returns the configured override, not the resolved translation.

Instance member Focusable​

Boolean: Gets or sets whether the outer container can receive focus. The default is false. (Default: False)

Instance member Icon​

String: Gets or sets a Wisej theme image name or URL. Empty uses the Kind illustration. (Default: "")

Instance member Image​

Image: Gets or sets the image displayed in preference to Icon and the default art. (Default: null)

The caller retains ownership. Clearing Image reveals Icon or the Kind illustration.

Instance member Kind​

EmptyStateKind: Gets or sets the default illustration and localized explanation. (Default: Empty)

Instance member SecondaryActionText​

String: Gets or sets the secondary action caption. Null or empty hides the action. (Default: null)

The default is null; there is no built-in action caption. Supply application text to display the action. Activating it raises SecondaryActionClick independently of the primary action.

Instance member TabStop​

Boolean: Gets or sets outer-container tab participation. Action buttons remain reachable when false. (Default: False)

Instance member TargetControl​

Control: Gets or sets an existing DataGridView or ListView whose empty collection controls this overlay. (Default: null)

The overlay becomes a sibling of the target and tracks its bounds and visibility. Collection and binding events update it automatically. A grid's new-record placeholder does not count as data. Call RefreshTarget after changing VirtualListSize. The target is never hidden or disposed. Clear this property for standalone use. Do not use a target in a layout-managed container such as FlowLayoutPanel.

Example:

var empty = new EmptyState { TargetControl = ordersGrid, Title = "No orders" };
ordersGrid.Rows.Add("Order 123"); // Automatically hides the overlay.

Instance member Title​

String: Gets or sets the heading. Null uses the localized Kind heading; empty hides it. (Default: null)

The default is null. The built-in heading is selected for Kind and the current UI culture when rendered. The getter returns the configured override, not the resolved translation.

Methods​

Protected member Dispose(disposing)​

Releases target subscriptions without disposing the borrowed target or image.

ParameterTypeDescription
disposingBooleanWhether managed resources can be released.

Protected member OnActionClick(e)​

Raises ActionClick without changing the displayed state.

ParameterTypeDescription
eEventArgsEvent data.

Protected member OnSecondaryActionClick(e)​

Raises SecondaryActionClick without changing the displayed state.

ParameterTypeDescription
eEventArgsEvent data.

Protected member OnWebEvent(e)​

Dispatches independent primary and secondary action requests.

ParameterTypeDescription
eWisejEventArgsClient event.

Protected member OnWebRender(config)​

Serializes localized captions and first-level properties and wires both ordinary events.

ParameterTypeDescription
configObjectClient configuration.

Instance member RefreshTarget()​

Synchronizes visibility after changes without collection events, such as VirtualListSize changes.

Events​

Instance member ActionClick​

EventHandler Occurs when the primary action is activated.

Instance member SecondaryActionClick​

EventHandler Occurs when the secondary action is activated.

Implements​

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IBindableComponentBindable components implement this interface.
IDropTargetControls that support drag & drop operations implement this interface.
IWisejComponentAll wisej components implement this interface.
IWisejControlAll wisej controls derived from the Control class must implement this interface.
IWisejSerializableAllows an object to serialize itself.