In multi-column mode, the edit box displays the selected row’s values separated by a semicolon. Use the TextFormatString property to format the selected item’s output text. The text pattern can contain literals and indexed placeholders such as {0}
, {1}
, and so on.
In this example, a radio button list control allows users to select a pattern to apply to the combo box text. The ASPxRadioButtonList.SelectedIndexChanged event handler sets the ASPxComboBox.TextFormatString property according to the selected pattern.
protected void ASPxRadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) {
if (ASPxRadioButtonList1.SelectedIndex == 0) {
ASPxComboBox1.TextFormatString = "{0} {1}, {2} Company";
}
if (ASPxRadioButtonList1.SelectedIndex == 1) {
ASPxComboBox1.TextFormatString = "{1} {0}, {2} Company";
}
}
- Default.aspx (VB: Default.aspx)
- Default.aspx.cs (VB: Default.aspx.vb)
(you will be redirected to DevExpress.com to submit your response)