CheckedListBox
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.1.0.0)
Displays a ListBox in which a check box is displayed to the left of each item.
- C#
- VB.NET
public class CheckedListBox : ListBox
Public Class CheckedListBox
Inherits ListBox
Constructors
CheckedListBox()
Initializes a new instance of the CheckedListBox class.
CheckedListBox(onItemCheck)
Initializes a new instance of the CheckedListBox class.
| Name | Type | Description |
|---|---|---|
| onItemCheck | Action<Object, ItemCheckEventArgs> | Optional ItemCheck handler. |
CheckedListBox(dataSource, displayMember, valueMember, iconMember, checkStateMember, onItemCheck)
Initializes a new instance of CheckedListBox class with the specified settings.
| Name | Type | Description |
|---|---|---|
| dataSource | Object | Initial DataSource. |
| displayMember | String | Initial DisplayMember. |
| valueMember | String | Initial ValueMember. |
| iconMember | String | Initial IconMember. |
| checkStateMember | String | Initial CheckStateMember. |
| onItemCheck | Action<Object, ItemCheckEventArgs> | Optional ItemCheck handler. |
CheckedListBox(location, size, onItemCheck)
Initializes a new instance of the CheckedListBox class with the specified settings.
| Name | Type | Description |
|---|---|---|
| location | Point | Initial location. |
| size | Size | Initial size. |
| onItemCheck | Action<Object, ItemCheckEventArgs> | Optional ItemCheck handler. |
CheckedListBox(location, size, dataSource, displayMember, valueMember, iconMember, checkStateMember, onItemCheck)
Initializes a new instance of the CheckedListBox class with the specified settings.
| Name | Type | Description |
|---|---|---|
| location | Point | Initial location. |
| size | Size | Initial size. |
| dataSource | Object | Initial DataSource. |
| displayMember | String | Initial DisplayMember. |
| valueMember | String | Initial ValueMember. |
| iconMember | String | Initial IconMember. |
| checkStateMember | String | Initial CheckStateMember. |
| onItemCheck | Action<Object, ItemCheckEventArgs> | Optional ItemCheck handler. |
Properties
CheckedIndices
CheckedIndexCollection: Collection of checked indexes in the CheckedListBox.
CheckedItems
CheckedObjectCollection: Collection of checked items in the CheckedListBox.
CheckOnClick
Boolean: Returns or sets whether list items are checked when they are clicked. The default is to check the item when clicking on the checkbox icon. (Default: False)
CheckStateMember
String: Returns or sets the property to bind to the CheckState of the items in the CheckedListBox control. (Default: "")
Items
ObjectCollection: Returns the collection of items in this CheckedListBox.
Separator
String: Returns or sets the separator used to concatenate and parse multiple checked values for the Text property. (Default: ",")
Methods
ClearChecked()
Unchecks all items in the CheckedListBox.
CreateItemCollection()
Creates a new instance of the item collection.
Returns: ObjectCollection. A ObjectCollection that represents the new item collection.
GetItemChecked(index)
Returns a value indicating whether the specified item is checked.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The index of the item. |
Returns: Boolean. true if the item is checked; otherwise, false.
Throws:
- ArgumentException The index specified is less than zero; or the index specified is greater than or equal to the count of items in the list.
GetItemCheckState(index)
Returns a value indicating the check state of the current item.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The index of the item to get the checked value of. |
Returns: CheckState. One of the CheckState values.
Throws:
- ArgumentOutOfRangeException The index specified is less than zero; or the index specified is greater than or equal to the count of items in the list.
OnAfterItemCheck(e)
Fires the AfterItemCheck event.
| Parameter | Type | Description |
|---|---|---|
| e | ItemCheckEventArgs | An ItemCheckEventArgs that contains the event data. |
OnCheckStateMemberChanged(e)
Fires the CheckStateMemberChanged event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | A EventArgs that contains the event data. |
OnItemCheck(e)
Fires the ItemCheck event.
| Parameter | Type | Description |
|---|---|---|
| e | ItemCheckEventArgs | An ItemCheckEventArgs that contains the event data. |
OnWebEvent(e)
Processes the event from the client.
| Parameter | Type | Description |
|---|---|---|
| e | WisejEventArgs | Event arguments. |
OnWebRender(config)
Renders the client component.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Dynamic configuration object. |
RefreshItem(index)
Refreshes the item contained at the specified location.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The location of the item to refresh. |
RefreshItems()
Reloads all the CheckedListBox items from the data source.
SetItemChecked(index, value)
Sets CheckState for the item at the specified index to Checked.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The index of the item to set the check state for. |
| value | Boolean | true to set the item as checked; otherwise, false. |
Throws:
- ArgumentException The index specified is less than zero; or the index is greater than the count of items in the list.
SetItemCheckState(index, value)
Sets the check state of the item at the specified index.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The index of the item to set the state for. |
| value | CheckState | One of the CheckState values. |
Throws:
- ArgumentOutOfRangeException The index specified is less than zero; or the index is greater than or equal to the count of items in the list.
SetItemCore(index, value)
Sets the object with the specified index in the derived class.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The array index of the object. |
| value | Object | The object. |
SetItemsCore(value)
Sets the specified array of objects in a collection in the derived class.
| Parameter | Type | Description |
|---|---|---|
| value | IList | An array of items. |
Events
AfterItemCheck
ItemCheckEventHandler Fired after the checked state of an item changes.
CheckStateMemberChanged
EventHandler Fired when the CheckStateMember property changes.
Click
EventHandler Fired when the user clicks the CheckedListBox control.
ItemCheck
ItemCheckEventHandler Fired when the checked state of an item changes.
MouseClick
MouseEventHandler Fired when the user clicks the CheckedListBox control with the mouse.
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. |
| ILabel | Provides access to the LabelWrapper associated with the controls that implement this interface. |
| IReadOnly | Provides access to the ReadOnly property for coontrols that support the read-only mode. |
| IModified | Provides access to the Modified property and ModifiedChanged event for controls that implement this interface. |
| IValidation | Provides access to the validation events and properties property for controls that support validation. |
| 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. |