ASPxClientListBox.AddItem(text) Method
Adds a new item to the editor, specifying the item’s display text, associated value and displayed image, and returns the index of the added item.
#Declaration
AddItem(
text: string | string[],
value?: any,
imageUrl?: string
): number
#Parameters
Name | Type | Description |
---|---|---|
text | string | string[] | A string value specifying the item’s display text. |
value | any | An object specifying the value associated with the item. |
image |
string | A string value specifying the path to the image displayed by the item. |
#Returns
Type | Description |
---|---|
number | The added item’s index. |
#Remarks
This method is not in effect, if an editor is used in multi-column mode.
Usage (JavaScript):
ASPxListBox1.AddItem('Column value', 123, 'Images/image.jpg');
Note
If an item with the specified image is added to the editor’s Items collection where no items have images yet, it is necessary to explicitly define the editor’s Item
Note
The Add
- Set the control’s Enable
Client property toSide API true
. - Set the control’s Enable
Callback property toMode true
. - Define the control’s Client
Instance property.Name - Handle any control’s client-side event (available via the control’s Client
Side property).Events