KanbanBoard
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.2.0.0)
Displays bound records in draggable status lanes with cancellable moves and work-in-progress limits.
- C#
- VB.NET
public class KanbanBoard : Control
Public Class KanbanBoard
Inherits Control
StatusMember must name a writable property for moves. OrderMember, when specified, is rewritten to consecutive zero-based positions in affected lanes. Without it, moves use a session-local order until the source is replaced. Unmapped records remain in the source but are not displayed. BindingList and collection/property notifications refresh the board; call RefreshData for plain lists.
Example:
var board = new KanbanBoard { Dock = DockStyle.Fill, StatusMember = "Status", TitleMember = "Title" };
board.Columns.Add(new KanbanColumn { Text = "Backlog", Value = "todo" });
board.Columns.Add(new KanbanColumn { Text = "In progress", Value = "doing", WipLimit = 3 });
board.DataSource = jobs; // An IList or a BindingSource.
board.CardMoving += (sender, e) => e.Cancel = !MayMove(e.Item);
this.Controls.Add(board);
Constructors
KanbanBoard()
Creates an empty board with draggable cards and four-column-friendly default geometry.
Properties
AllowDrag
Boolean: Gets or sets whether browser drag and keyboard move requests are accepted. (Default: True)
This card-level setting is independent of Control.AllowDrag, which applies to dragging the board surface itself. The surface remains non-draggable; programmatic MoveCard calls are still allowed.
AllowReorder
Boolean: Gets or sets whether cards may be reordered within their current column. (Default: True)
AutoSizeColumns
Boolean: Gets or sets whether columns share available width while retaining ColumnWidth as their minimum. (Default: True)
AvatarMember
String: Gets or sets the optional person-name property displayed as initials. (Default: "")
CardTemplate
Type: Gets or sets a concrete UserControl type with a public parameterless constructor. (Default: null)
Null uses built-in cards. Instances are created only for visible cards, owned by the board, and disposed when no longer visible. Tag receives the record. Implement IKanbanCardTemplate to receive DataItem during creation and refresh; interactive children handle their own input.
Example:
board.CardTemplate = typeof(MyJobCard); // UserControl implementing IKanbanCardTemplate.
Columns
KanbanColumnCollection: Gets the ordered status columns. Values must be unique when data is displayed or moved.
ColumnWidth
Int32: Gets or sets the fixed or minimum lane width in pixels. (Default: 260)
DataSource
Object: Gets or sets the IList, IListSource, DataTable, or BindingSource supplying records. (Default: null)
Null clears the board. Records must be non-null reference objects and cannot occur twice. Replacing the source disposes all custom templates and resets session-local ordering.
DefaultSize
Size: Gets the default board dimensions.
Focusable
Boolean: Gets or sets whether the board surface can receive focus. Defaults to false. (Default: False)
MaxVisibleCards
Int32: Gets or sets the initial visible cards per column. The More button expands that column. (Default: 20)
MetaMember
String: Gets or sets the optional secondary text property. (Default: "")
MoreItemsText
String: Gets or sets the localized override for the "+ {0} more" text. (Default: null)
The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation. {0} is the hidden card count. Used for the CLDR other category of the current UI culture. Literal braces can be written as {{ and }}.
MoreItemText
String: Gets or sets the localized override for the "+ {0} more" text. (Default: null)
The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation. {0} is the hidden card count. Used for the CLDR one category of the current UI culture. Literal braces can be written as {{ and }}.
OrderMember
String: Gets or sets the optional writable numeric sort property. Empty retains session-local order. (Default: "")
ProgressMember
String: Gets or sets the optional finite percentage property, clamped to zero through 100 for display. (Default: "")
StatusMember
String: Gets or sets the writable property mapped to column Value. (Default: "Status")
TabStop
Boolean: Gets or sets whether the board itself participates in tab navigation. Cards remain independently focusable. (Default: False)
TagMember
String: Gets or sets the optional card tag text property. (Default: "")
TagToneMember
String: Gets or sets the optional MeterTone name or value property for card tags. (Default: "")
TitleMember
String: Gets or sets the literal card title property. (Default: "Title")
Methods
Dispose(disposing)
Releases source subscriptions and owned custom templates.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | Whether managed resources are released. |
MoveCard(item, column, index)
Requests a move, validates the destination, and writes the bound status and optional order.
| Parameter | Type | Description |
|---|---|---|
| item | Object | Record in DataSource. |
| column | KanbanColumn | Destination owned by this board. |
| index | Int32 | Zero-based position, or -1 to append. |
Returns: Boolean. True when the move is committed or already at that position.
Index is the destination position after removing the moving card; -1 appends. False indicates cancellation, a disabled destination, a WIP rejection, or a forbidden same-column reorder. Programmatic moves do not require AllowDrag. Read-only or incompatible data members throw. Property setter failures attempt to restore prior values; source setters should support rollback.
Example:
bool accepted = board.MoveCard(job, board.Columns[1], 0);
OnCardClick(e)
Raises CardClick for subscribers and derived controls.
| Parameter | Type | Description |
|---|---|---|
| e | KanbanCardEventArgs | Event data. |
OnCardDoubleClick(e)
Raises CardDoubleClick for subscribers and derived controls.
| Parameter | Type | Description |
|---|---|---|
| e | KanbanCardEventArgs | Event data. |
OnCardMoved(e)
Raises CardMoved for subscribers and derived controls.
| Parameter | Type | Description |
|---|---|---|
| e | KanbanCardMoveEventArgs | Event data. |
OnCardMoving(e)
Raises CardMoving for subscribers and derived controls.
| Parameter | Type | Description |
|---|---|---|
| e | KanbanCardMoveEventArgs | Event data. |
OnWebEvent(e)
Dispatches browser requests to validated server handlers.
| Parameter | Type | Description |
|---|---|---|
| e | WisejEventArgs | Client event data. |
OnWebRender(config)
Renders independent behavior and layout settings and a revisioned column/card snapshot.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Client configuration. |
OnWipLimitExceeded(e)
Raises WipLimitExceeded for subscribers and derived controls.
| Parameter | Type | Description |
|---|---|---|
| e | KanbanCardMoveEventArgs | Event data. |
RefreshCard(item)
Refreshes the presentation of a source record without replacing the source.
| Parameter | Type | Description |
|---|---|---|
| item | Object | Record belonging to DataSource. |
RefreshData()
Refreshes the bound list, template records, and browser snapshot after plain-list changes.
Events
CardClick
EventHandler<KanbanCardEventArgs> Occurs when a card is clicked or activated with Enter or Space.
CardDoubleClick
EventHandler<KanbanCardEventArgs> Occurs when a card is double-clicked.
CardMoved
EventHandler<KanbanCardMoveEventArgs> Occurs after status and order changes have been committed.
CardMoving
EventHandler<KanbanCardMoveEventArgs> Occurs before a permitted move is committed. Set Cancel to reject it.
WipLimitExceeded
EventHandler<KanbanCardMoveEventArgs> Occurs when the destination limit rejects a move. The record is unchanged.
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. |