Back to Devexpress

ListEditItem.Text Property

aspnet-devexpress-dot-web-dot-listedititem.md

latest4.5 KB
Original Source

ListEditItem.Text Property

Gets or sets the list item’s text.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue("")]
public override string Text { get; set; }
vb
<DefaultValue("")>
Public Overrides Property Text As String

Property Value

TypeDefaultDescription
StringString.Empty

A String value representing the list item’s text.

|

Remarks

Use the Text property to specify the textual representation of the current list item.

Note

This property is not in effect for an editor’s multi-column mode.

Example

View Example: Popup Control for ASP.NET Web Forms - How to show a pop-up window.

javascript
function OnComboBoxSelectedIndexChanged(s, e) {
    var item = s.GetSelectedItem();
    popup.SetContentHTML(
        "Selected item changed:

" +
        "  <strong>text=</strong>'" + item.text + "'
" +
        "  <strong>value</strong>=" + item.value + "

");
    popup.ShowAtElementByID("comboPopupAnchor");
}
aspx
<dxe:ASPxComboBox ID="cbCombo" runat="server" Width="170px" ClientInstanceName="combo">
    <ClientSideEvents SelectedIndexChanged="OnComboBoxSelectedIndexChanged" />
    <Items>
        <dxe:ListEditItem Text="Item #1" Value="0" />
        <dxe:ListEditItem Text="Item #2" Value="1" />
        <dxe:ListEditItem Text="Item #3" Value="2" />
    </Items>
</dxe:ASPxComboBox>

The following code snippets (auto-collected from DevExpress Examples) contain references to the Text property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-mvc-scheduler-custom-appointment-form/CS/Models/Scheduling.cs#L53

csharp
foreach (ListEditItem item in rawDataSource) {
    yield return new { Value = item.Value, Text = item.Text };
}

asp-net-web-forms-scheduler-custom-adaptive-form-using-templates/CS/WebApplication1/DevExpress/ASPxSchedulerForms/AppointmentForm.ascx.cs#L239

csharp
if(editItem.Selected)
        result.Add(editItem.Text);
}

asp-net-mvc-scheduler-custom-appointment-form/VB/Models/Scheduling.vb#L56

vb
For Each item As ListEditItem In rawDataSource
    Yield New With {item.Value, item.Text}
Next

asp-net-web-forms-scheduler-custom-adaptive-form-using-templates/VB/WebApplication1/DevExpress/ASPxSchedulerForms/AppointmentForm.ascx.vb#L248

vb
If editItem.Selected Then
    result.Add(editItem.Text)
End If

See Also

Value

ListEditItem Class

ListEditItem Members

DevExpress.Web Namespace