Skip to main content
Version: 4.1

CheckedListBoxExtensions

Namespace: Wisej.Web.Markup

Assembly: Wisej.Framework (4.1.0.0)

Adds fluent markup extension methods to the CheckedListBox class.

public class CheckedListBoxExtensions

Methods

Static member CheckOnClick<TListBox>(listBox, value)

Sets the CheckOnClick property of the specified CheckedListBox.

ParameterTypeDescription
TListBoxThe type of the checked list box, must inherit from CheckedListBox.
listBoxTListBoxThe checked list box for which to set the CheckOnClick property.
valueBooleanA 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);

Static member CheckStateMember<TListBox>(listBox, checkStateMember)

Sets the CheckStateMember property of the specified CheckedListBox.

ParameterTypeDescription
TListBoxThe type of the checked list box, must inherit from CheckedListBox.
listBoxTListBoxThe checked list box for which to set the CheckStateMember property.
checkStateMemberStringThe 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");

Static member OnAfterItemCheck<TListBox>(listBox, action)

Attaches an event handler for the AfterItemCheck event of the specified CheckedListBox.

ParameterTypeDescription
TListBoxThe type of the checked list box, must inherit from CheckedListBox.
listBoxTListBoxThe checked list box to attach the event handler to.
actionAction<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!");
});

Static member OnCheckStateMemberChanged<TListBox>(listBox, action)

Attaches an event handler for the CheckStateMemberChanged event of the specified CheckedListBox.

ParameterTypeDescription
TListBoxThe type of the checked list box, must inherit from CheckedListBox.
listBoxTListBoxThe checked list box to attach the event handler to.
actionAction<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!");
});

Static member OnItemCheck<TListBox>(listBox, action)

Attaches an event handler for the ItemCheck event of the specified CheckedListBox.

ParameterTypeDescription
TListBoxThe type of the checked list box, must inherit from CheckedListBox.
listBoxTListBoxThe checked list box to attach the event handler to.
actionAction<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!");
});

Static member Separator<TListBox>(listBox, separator)

Sets the Separator property of the specified CheckedListBox.

ParameterTypeDescription
TListBoxThe type of the checked list box, must inherit from CheckedListBox.
listBoxTListBoxThe checked list box for which to set the Separator property.
separatorStringThe 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(", ");