ChipGroup
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.2.0.0)
Displays wrapping selectable chips with optional counts and close buttons.
- C#
- VB.NET
public class ChipGroup : SegmentedButton
Public Class ChipGroup
Inherits SegmentedButton
Uses the same Items and selection API as SegmentedButton. Appearance styles each chip independently. Stretch places each chip on its own row and fills the available width. Closing removes the item and updates selection before ChipClosed. Segment.Count is nullable; null hides a count even when ShowCounts is true. Disabled chips cannot be closed by users.
Example:
var filters = new ChipGroup { SelectionMode = SegmentSelectionMode.Multiple, Closable = true, ShowCounts = true };
filters.Items.Add(new Segment { Text = "Open", Count = 24, Value = "open" });
filters.Items.Add(new Segment { Text = "Assigned", Count = 8, Value = "mine" });
filters.SetSelected(0, true);
filters.ChipClosed += (s, e) => MessageBox.Show("Removed " + e.Item.Text);
Controls.Add(filters);
Constructors
ChipGroup()
Initializes a new instance of ChipGroup.
Properties
Closable
Boolean: Gets or sets whether enabled chips expose an independent close action. (Default: False)
CloseText
String: Gets or sets the localized override for the "Close {0}" 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 item caption. Literal braces can be written as {{ and }}.
DefaultSize
Size: Gets the default 360 by 120 pixel wrapping area.
ShowCounts
Boolean: Gets or sets whether non-null segment counts are displayed. (Default: False)
Methods
OnChipClosed(e)
Raises ChipClosed, including derived overrides without subscribers.
| Parameter | Type | Description |
|---|---|---|
| e | SegmentEventArgs | Removed chip data. |
OnWebEvent(e)
Dispatches chip removal independently of selection activation.
| Parameter | Type | Description |
|---|---|---|
| e | WisejEventArgs | Client event. |
OnWebRender(config)
Adds chip count and close presentation to the shared snapshot.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Client configuration. |
Events
ChipClosed
EventHandler<SegmentEventArgs> Occurs after a user closes and removes a chip. Index is its former position.
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. |