CheckedListBoxExtensions
Namespace: Wisej.Web.Markup
Assembly: Wisej.Framework (4.1.0.0)
Adds fluent markup extension methods to the CheckedListBox class.
- C#
- VB.NET
public class CheckedListBoxExtensions
Public Class CheckedListBoxExtensions
Methods
CheckOnClick<TListBox>(listBox, value)
Sets the CheckOnClick property of the specified CheckedListBox.
| Parameter | Type | Description |
|---|---|---|
| TListBox | The type of the checked list box, must inherit from CheckedListBox. | |
| listBox | TListBox | The checked list box for which to set the CheckOnClick property. |
| value | Boolean | A boolean indicating whether items are checked on click. |
Returns: TListBox. The modified checked list box with the updated CheckOnClick property.
This method allows you to specify whether items in the list box are checked or unchecked when clicked.
myCheckedListBox.CheckOnClick(true);
CheckStateMember<TListBox>(listBox, checkStateMember)
Sets the CheckStateMember property of the specified CheckedListBox.
| Parameter | Type | Description |
|---|---|---|
| TListBox | The type of the checked list box, must inherit from CheckedListBox. | |
| listBox | TListBox | The checked list box for which to set the CheckStateMember property. |
| checkStateMember | String | The property to use as the check state for the list items. |
Returns: TListBox. The modified checked list box with the updated CheckStateMember property.
This method allows you to set the property to use as the check state for the list items.
myCheckedListBox.CheckStateMember("IsChecked");
OnAfterItemCheck<TListBox>(listBox, action)
Attaches an event handler for the AfterItemCheck event of the specified CheckedListBox.
| Parameter | Type | Description |
|---|---|---|
| TListBox | The type of the checked list box, must inherit from CheckedListBox. | |
| listBox | TListBox | The checked list box to attach the event handler to. |
| action | Action<TListBox, ItemCheckEventArgs> | An action to execute after an item's checked state changes. |
Returns: TListBox. The modified checked list box with the attached AfterItemCheck event handler.
This method allows you to execute a custom action after an item's checked state changes in the list box.
myCheckedListBox.OnAfterItemCheck((lb, args) =>
{
AlertBox.Show("Item check state changed post-event!");
});
OnCheckStateMemberChanged<TListBox>(listBox, action)
Attaches an event handler for the CheckStateMemberChanged event of the specified CheckedListBox.
| Parameter | Type | Description |
|---|---|---|
| TListBox | The type of the checked list box, must inherit from CheckedListBox. | |
| listBox | TListBox | The checked list box to attach the event handler to. |
| action | Action<TListBox> | An action to execute when the CheckStateMember property changes. |
Returns: TListBox. The modified checked list box with the attached CheckStateMemberChanged event handler.
This method allows you to execute a custom action whenever the CheckStateMember property changes in the list box.
myCheckedListBox.OnCheckStateMemberChanged(lb =>
{
AlertBox.Show("CheckStateMember property changed!");
});
OnItemCheck<TListBox>(listBox, action)
Attaches an event handler for the ItemCheck event of the specified CheckedListBox.
| Parameter | Type | Description |
|---|---|---|
| TListBox | The type of the checked list box, must inherit from CheckedListBox. | |
| listBox | TListBox | The checked list box to attach the event handler to. |
| action | Action<TListBox, ItemCheckEventArgs> | An action to execute when an item's checked state changes. |
Returns: TListBox. The modified checked list box with the attached ItemCheck event handler.
This method allows you to execute a custom action whenever an item's checked state changes in the list box.
myCheckedListBox.OnItemCheck((lb, args) =>
{
AlertBox.Show("Item check state changed!");
});
Separator<TListBox>(listBox, separator)
Sets the Separator property of the specified CheckedListBox.
| Parameter | Type | Description |
|---|---|---|
| TListBox | The type of the checked list box, must inherit from CheckedListBox. | |
| listBox | TListBox | The checked list box for which to set the Separator property. |
| separator | String | The string to use as a separator for the list items. |
Returns: TListBox. The modified checked list box with the updated Separator property.
This method allows you to set a custom separator for the list items.
myCheckedListBox.Separator(", ");