EmptyState
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.2.0.0)
Displays an illustration, explanation, and optional actions when a view has no content.
- C#
- VB.NET
public class EmptyState : Control
Public Class EmptyState
Inherits 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
EmptyState()
Creates a placeholder whose action buttons participate in keyboard navigation.
Properties
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.
Bordered
Boolean: Gets or sets whether the themed dashed outline is displayed. (Default: False)
Compact
Boolean: Gets or sets whether a compact horizontal layout is used. (Default: False)
DefaultSize
Size: Gets the default 420 by 220 pixel size.
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.
Focusable
Boolean: Gets or sets whether the outer container can receive focus. The default is false. (Default: False)
Icon
String: Gets or sets a Wisej theme image name or URL. Empty uses the Kind illustration. (Default: "")
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.
Kind
EmptyStateKind: Gets or sets the default illustration and localized explanation. (Default: Empty)
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.
TabStop
Boolean: Gets or sets outer-container tab participation. Action buttons remain reachable when false. (Default: False)
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.
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
Dispose(disposing)
Releases target subscriptions without disposing the borrowed target or image.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | Whether managed resources can be released. |
OnActionClick(e)
Raises ActionClick without changing the displayed state.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | Event data. |
OnSecondaryActionClick(e)
Raises SecondaryActionClick without changing the displayed state.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | Event data. |
OnWebEvent(e)
Dispatches independent primary and secondary action requests.
| Parameter | Type | Description |
|---|---|---|
| e | WisejEventArgs | Client event. |
OnWebRender(config)
Serializes localized captions and first-level properties and wires both ordinary events.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Client configuration. |
RefreshTarget()
Synchronizes visibility after changes without collection events, such as VirtualListSize changes.
Events
ActionClick
EventHandler Occurs when the primary action is activated.
SecondaryActionClick
EventHandler Occurs when the secondary action is activated.
Implements
| Name | Description |
|---|---|
| IUserData | Provides access to the UserData and Tag properties associated to the component implementing this interface. |
| IBindableComponent | Bindable components implement this interface. |
| IDropTarget | Controls that support drag & drop operations implement this interface. |
| IWisejComponent | All wisej components implement this interface. |
| IWisejControl | All wisej controls derived from the Control class must implement this interface. |
| IWisejSerializable | Allows an object to serialize itself. |