aspnet-devexpress-dot-web-823b9e09.md
A list item.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
public class ListEditItem :
ListEditItemBase
Public Class ListEditItem
Inherits ListEditItemBase
The following members return ListEditItem objects:
Show 14 links
The ListEditItem class implements the item functionality of a list editor (for instance, the ASPxListBox, ASPxRadioButtonList, or ASPxComboBox).
The ListEditItemCollection collection contains instances of the ListEditItem object. To access this collection, use the Items property (for instance, the ASPxListEdit.Items and ASPxAutoCompleteBoxBase.Items properties).
Add a ListEditItem object to the ListEditItemCollection collection and specify item characteristics:
ListEditItem.Value - Specifies the item’s value.
ListEditItem.Text - Specifies the item’s text.
ListEditItem.ImageUrl - Specifies the item’s image.
<dx:ASPxComboBox ID="ASPxComboBox1" runat="server">
<Items>
<dx:ListEditItem Text="Alexandra Camino" Value="1" />
<dx:ListEditItem Text="Alexander Feuer" Value="2" />
<dx:ListEditItem Text="Ana Trujillo" Value="3" />
</Items>
</dx:ASPxComboBox>
using DevExpress.Web;
//...
protected void Page_Load(object sender, EventArgs e) {
ASPxComboBox cb = new ASPxComboBox();
cb.ID = "ASPxComboBox1";
formLayoutDetails.Controls.Add(cb);
// Add items to the drop-down list.
cb.Items.Add("Alexandra Camino", "1");
cb.Items.Add("Alexander Feuer", "2");
cb.Items.Add("Ana Trujillo", "3");
}
Use the Item[Int32] property to access an individual item by its index in the item collection.
ListEditItem a = combobox.Items[0];
You can populate the data source with new items at run time.
Follow the steps below to add an item to the data source:
Handle the client-side TextChanged event. If you enter a new item, the control sends a callback to the server with the typed text as a parameter.
Handle the server-side ASPxAutoCompleteBoxBase.Callback event raised by the PerformCallback method.
Set the EnableViewState property to false. In this mode, the control does not maintain its view state.
Object StateManager CollectionItem ListEditItemBase ListEditItem ToolbarListEditItem
See Also