I am experiencing the follow problem with the MultiColumn ComboBox control.
First I setup the MultiColumn ComboBox as follows:
On the SelectedIndexChange event of another ComboBox I set the filter for the datasource as follows:
Now when the filtering results in 0 rows in the DataSource the Text property retains the previous value and I can not seem to clear it not matter what properties I change.
First I setup the MultiColumn ComboBox as follows:
CategoryRadMultiColumnComboBox.DataSource = _categoriesBindingSource; |
CategoryRadMultiColumnComboBox.DisplayMember = "CategoryName"; |
CategoryRadMultiColumnComboBox.ValueMember = "CategoryId"; |
CategoryRadMultiColumnComboBox.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList; |
RadMultiColumnComboBoxElement categoriesElement = CategoryRadMultiColumnComboBox.MultiColumnComboBoxElement; categoriesElement.EditorControl.MasterGridViewTemplate.AutoGenerateColumns = false; categoriesElement.EditorControl.MasterGridViewTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; categoriesElement.EditorControl.MasterGridViewTemplate.Columns.Clear(); |
categoriesElement.Columns.Add(CreateGridViewDataColumn("StandardId")); |
categoriesElement.Columns.Add(CreateGridViewDataColumn("CategoryId")); |
categoriesElement.Columns.Add(CreateGridViewTextBoxColumn("#", "CategoryNumber", 30, 30)); |
categoriesElement.Columns.Add(CreateGridViewTextBoxColumn("Name", "CategoryName", 100)); |
On the SelectedIndexChange event of another ComboBox I set the filter for the datasource as follows:
private void StandardRadMultiColumnComboBox_SelectedIndexChanged(object sender, EventArgs e) |
{ |
RadMultiColumnComboBox cbo = (RadMultiColumnComboBox)sender; |
_categoriesBindingSource.Filter = String.Format("StandardId = '{0}'", cbo.SelectedValue.ToString()); |
RadMultiColumnComboBoxElement categoriesElement = CategoryRadMultiColumnComboBox.MultiColumnComboBoxElement; |
if (categoriesElement.Rows != null && categoriesElement.Rows.Count == 0 && CategoryRadMultiColumnComboBox.SelectedItem != null) |
{ |
CategoryRadMultiColumnComboBox.SelectedItem = null; |
CategoryRadMultiColumnComboBox.SelectedValue = null; |
CategoryRadMultiColumnComboBox.Text = " "; |
} |
} |
Now when the filtering results in 0 rows in the DataSource the Text property retains the previous value and I can not seem to clear it not matter what properties I change.