Back to Devexpress

ASPxComboBox.Text Property

aspnet-devexpress-dot-web-dot-aspxcombobox-f4116e27.md

latest3.4 KB
Original Source

ASPxComboBox.Text Property

Gets the text displayed within the editor’s edit box.

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

The textual representation of the editor’s value.

|

Remarks

The property is overridden only for the purpose of preventing it from appearing in Microsoft Visual Studio designer tools.

aspx
<dx:ASPxComboBox ID="ComboBox" runat="server" ValueType="System.String" TextField="ProductName"
    OnTextChanged="ComboBox_TextChanged">
    <!-- ... -->
</dx:ASPxComboBox>
csharp
protected void ComboBox_TextChanged(object sender, EventArgs e) {
    var text = ComboBox.Text;
    // ...
}
vb
Protected Sub ComboBox_TextChanged(ByVal sender As Object, ByVal e As EventArgs)
    Dim text = ComboBox.Text
    ' ...
End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference 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-web-forms-editors-create-registration-form/CS/ASPxEditorsTutorial.Step4/RegistrationForm.aspx.cs#L28

csharp
command.Parameters.AddWithValue("birthDate", birthDateEdit.Date.ToShortDateString());
command.Parameters.AddWithValue("country", countryComboBox.Text);
command.Parameters.AddWithValue("city", cityComboBox.Text);

asp-net-web-forms-editors-create-registration-form/VB/ASPxEditorsTutorial.Step4/RegistrationForm.aspx.vb#L27

vb
command.Parameters.AddWithValue("birthDate", birthDateEdit.Date.ToShortDateString())
command.Parameters.AddWithValue("country", countryComboBox.Text)
command.Parameters.AddWithValue("city", cityComboBox.Text)

See Also

Combo Box

ASPxComboBox Class

ASPxComboBox Members

DevExpress.Web Namespace