ActionCardList
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.2.0.0)
Displays a data-bound, fixed-height virtual window of ActionCard controls.
- C#
- VB.NET
public class ActionCardList : Control
Public Class ActionCardList
Inherits Control
Only WindowSize cards exist at once; scrolling disposes outgoing cards and creates incoming cards. This virtualizes controls, not source data: the full IList remains available on the server. Use CardCreated to attach actions and content, storing persistent state in the source record. Content created for a card is disposed with that card when it leaves the window.
Example:
var list = new ActionCardList { Dock = DockStyle.Fill, ItemHeight = 108 };
list.DisplayMembers.Title = "Name";
list.CardCreated += (sender, e) =>
{
e.Card.Actions.Add(new CardAction { Name = "open", Text = "Open" });
e.Card.ActionClick += (s, a) => MessageBox.Show(e.DataItem.ToString());
};
list.DataSource = jobs; // IList, BindingList, DataTable, or BindingSource.
this.Controls.Add(list);
Constructors
ActionCardList()
Initializes an empty virtual list with a 32-card window.
Properties
DataMember
String: Gets or sets the list-valued member resolved from DataSource. Empty uses the source directly. (Default: "")
DataSource
Object: Gets or sets the source list, list source, BindingSource, or object resolved through DataMember. (Default: null)
Binding-list and collection notifications rebuild the current window. Plain lists require RefreshData. Source notifications must occur in the owning Wisej session. No data is sent beyond the materialized window.
DefaultSize
Size: Gets the default list size.
DisplayMembers
ActionCardDisplayMembers: Gets the source property mappings. Set mappings before DataSource when possible.
Focusable
Boolean: Gets or sets whether the list can receive the focus. The default is false. (Default: False)
ItemCount
Int32: Gets the current number of source records.
ItemHeight
Int32: Gets or sets each card's fixed height in pixels. The default is 108. (Default: 108)
Fixed geometry permits accurate virtual scrolling. Choose a height that contains all card text and content.
ItemSpacing
Int32: Gets or sets the gap between cards in pixels. The default is 8. (Default: 8)
MaterializedCount
Int32: Gets the current number of instantiated cards, never exceeding WindowSize.
TabStop
Boolean: Gets or sets whether the list takes part in tab navigation. The default is false. (Default: False)
WindowSize
Int32: Gets or sets the maximum number of materialized cards, from 1 through 200. The default is 32. (Default: 32)
The window must cover the viewport plus several offscreen rows. Increasing it reduces scroll requests at the cost of more server controls and DOM widgets; it never changes the source collection.
Methods
Dispose(disposing)
Detaches source notifications and disposes the materialized card window.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | Whether managed resources are released. |
OnCardCreated(e)
Raises CardCreated independently of event subscriptions.
| Parameter | Type | Description |
|---|---|---|
| e | ActionCardListItemEventArgs | New card and source record. |
OnDataSourceChanged(e)
Raises DataSourceChanged.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | Event data. |
OnItemClick(e)
Raises ItemClick.
| Parameter | Type | Description |
|---|---|---|
| e | ActionCardListItemEventArgs | Clicked card and source record. |
OnWebEvent(e)
Dispatches virtual range requests.
| Parameter | Type | Description |
|---|---|---|
| e | WisejEventArgs | Client event. |
OnWebRender(config)
Serializes only the virtual window and its scroll geometry.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Client configuration. |
RefreshData()
Rebuilds the current window after a plain source list or its records change.
Existing cards and content are disposed, and CardCreated runs for the refreshed window. The current scroll position is retained and clamped when the source becomes shorter.
Events
CardCreated
EventHandler<ActionCardListItemEventArgs> Occurs after a card is created and mapped, before it enters the displayed window.
Add commands, content, and event handlers here. Do not retain the transient card after it leaves the window. Changing the source from this callback is not supported.
DataSourceChanged
EventHandler Occurs after DataSource changes.
ItemClick
EventHandler<ActionCardListItemEventArgs> Occurs when a materialized card header is invoked.
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. |