To reproduce:
- Bind the control and set the auto filter functionality.
- Type a value and press the tab key or click ouside of the control.
- Subscribe to the DropDownClosed event and observe that the SelectedValue and the text are different.
Workaround:
void radMultiColumnComboBox1_DropDownClosed(object sender, Telerik.WinControls.UI.RadPopupClosedEventArgs args)
{
this.radMultiColumnComboBox1.Text = this.radMultiColumnComboBox1.SelectedValue.ToString();
}
To reproduce: - Add some items to the control and set the DropDownAnimationEnabled to false. - Programmatically select the third item - Start the application, open the drop down and scroll up with the mouse - you will notice that the grid is not scrolled up. Workaround: Set DropDownAnimationEnabled to true.
When set the SelectedIndex property in the DropDownClosed event selected index is not set correctly.
Workaround:
private void radMultiColumnComboBox1_DropDownClosed(object sender, Telerik.WinControls.UI.RadPopupClosedEventArgs args)
{
this.radMultiColumnComboBox1.SelectedIndex = 0;
this.radMultiColumnComboBox1.EditorControl.CurrentRowChanging += new CurrentRowChangingEventHandler(EditorControl_CurrentRowChanging);
}
void EditorControl_CurrentRowChanging(object sender, CurrentRowChangingEventArgs e)
{
e.Cancel = true;
this.radMultiColumnComboBox1.EditorControl.CurrentRowChanging -= EditorControl_CurrentRowChanging;
}
When filtering is applied to RadMultiColumnComboBox editor in CellEditorInitialized event of RadGridView, the selected item is second one, if the new row is edited.
Workaround: change the event handler by adding the following lines of code in the end of the RadGridView1_CellEditorInitialized:
Dim value As Object = e.Row.Cells(e.ColumnIndex).Value
If value Is Nothing Then
editor.EditorControl.CurrentRow = Nothing
Else
editor.Value = e.Row.Cells(e.ColumnIndex).Value
End If
To reproduce:
private void Form1_Load(object sender, EventArgs e)
{
this.categoriesTableAdapter.Fill(this.nwindDataSet.Categories);
this.radMultiColumnComboBox1.DataSource = this.categoriesBindingSource;
this.radMultiColumnComboBox1.DisplayMember = "CategoryName";
this.radMultiColumnComboBox1.ValueMember = "CategoryID";
this.radMultiColumnComboBox1.EditorControl.EnableFiltering = true;
this.radMultiColumnComboBox1.EditorControl.ShowHeaderCellButtons = true;
}
Workaround:
public Form1()
{
InitializeComponent();
this.radMultiColumnComboBox1.MultiColumnComboBoxElement.PopupClosing += MultiColumnComboBoxElement_PopupClosing;
this.radMultiColumnComboBox1.EditorControl.FilterPopupInitialized += EditorControl_FilterPopupInitialized;
}
private void EditorControl_FilterPopupInitialized(object sender, FilterPopupInitializedEventArgs e)
{
RadListFilterPopup filterPopup = e.FilterPopup as RadListFilterPopup;
if (filterPopup != null)
{
filterPopup.PopupOpened -= filterPopup_PopupOpened;
filterPopup.PopupOpened += filterPopup_PopupOpened;
filterPopup.PopupClosed -= filterPopup_PopupClosed;
filterPopup.PopupClosed += filterPopup_PopupClosed;
}
}
bool shouldCancel = false;
private void filterPopup_PopupClosed(object sender, RadPopupClosedEventArgs args)
{
shouldCancel = false;
}
private void filterPopup_PopupOpened(object sender, EventArgs args)
{
shouldCancel = true;
}
private void MultiColumnComboBoxElement_PopupClosing(object sender, RadPopupClosingEventArgs args)
{
args.Cancel = shouldCancel;
}
As the Subject states, we are running into issues where the combo is not fully displaying the first time it is opened. Run the form on high DPI, open the popup, and scroll to the botom:
To reproduce:
1. Run the form with RadMultiColumnCombobox on high dpi.
2. Set SelectedIndex to -1 (no value selected initially)
3. As a result, the first value get displayed in the text area.
In this particular case, the RadMultiColumnComboBoxElement is used as a custom editor inside RadPropertyGrid control. When the editor is shown it needs to be opened 3 times to correctly calculate its width. In addition, the font is scaled twice:
Use the following code and try to scroll item by item with the mouse wheel:
public RadForm1()
{
InitializeComponent();
DataTable dt = new DataTable();
dt.Columns.Add("Id", typeof(int));
dt.Columns.Add("Name", typeof(string));
for (int i = 0; i < 20; i++)
{
dt.Rows.Add(i, "Item"+i);
}
this.radMultiColumnComboBox1.DisplayMember = "Name";
this.radMultiColumnComboBox1.ValueMember = "Id";
this.radMultiColumnComboBox1.DataSource = dt;
this.radMultiColumnComboBox1.ScrollOnMouseWheel = true;
this.radMultiColumnComboBox1.SelectedValueChanged+=radMultiColumnComboBox1_SelectedValueChanged;
}
private void radMultiColumnComboBox1_SelectedValueChanged(object sender, EventArgs e)
{
Console.WriteLine("Value: "+this.radMultiColumnComboBox1.SelectedValue);
}Expected behavior: one item is scrolled at a time
Actual behavior: two items are scrolled at a time
Note: RadDropDownList behaves as expected.
- Add a RadMultiColumnComboBox and populate it with data.
- Hide most of the columns.
- Enable the AutoSizeDropDownToBestFit property
Note: the issue is reproducible with ControlDefault, Office2019Light, Desert. But it is NOT reproducible with Fluent
private void RadForm1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'nwindDataSet.Orders' table. You can move, or remove it, as needed.
this.ordersTableAdapter.Fill(this.nwindDataSet.Orders);
this.radMultiColumnComboBox1.DisplayMember = "OrderID";
this.radMultiColumnComboBox1.ValueMember = "OrderID";
this.radMultiColumnComboBox1.DataSource = ((DataSet)ordersBindingSource.DataSource).Tables[0].AsEnumerable().Reverse().Take(5);
this.radMultiColumnComboBox1.UseCompatibleTextRendering = false;
foreach (GridViewColumn col in this.radMultiColumnComboBox1.EditorControl.Columns)
{
if (!col.Name.Contains("ID") && !col.Name.Contains("OrderDate"))
{
col.IsVisible = false;
}
}
this.radMultiColumnComboBox1.AutoSizeDropDownColumnMode = BestFitColumnMode.AllCells;
this.radMultiColumnComboBox1.AutoSizeDropDownToBestFit = true;
return;
}Expected result:
Actual result:
Workaround: instead of hiding the redundant columns, you can remove them:
List<string> columnNames = new List<string>();
foreach (GridViewColumn col in this.radMultiColumnComboBox1.EditorControl.Columns)
{
if (!col.Name.Contains("ID") && !col.Name.Contains("OrderDate"))
{
columnNames.Add(col.Name);
//col.IsVisible = false;
}
}
while (columnNames.Count>0)
{
this.radMultiColumnComboBox1.Columns.Remove(columnNames[0]);
columnNames.RemoveAt(0);
}
This scenario is reproducible when the MCCB dropdown has 1 item. To disable the selection of the row we can set the EditorControl.CurrentRow to null. However, when the dropdown is open the Text property is set to the first row.
This issue is reproducible only in .NET 6. It works OK in .NET 4.8.
Use the following code snippet:
public RadForm1()
{
InitializeComponent();
List<Student> collectionOfStudents = new List<Student>();
collectionOfStudents.Add(new Student(0, "Peter", "A+"));
collectionOfStudents.Add(new Student(1, "John", "D-"));
collectionOfStudents.Add(new Student(2, "Antony", "B+"));
collectionOfStudents.Add(new Student(3, "David", "A-"));
collectionOfStudents.Add(new Student(4, "John", "D-"));
this.radMultiColumnComboBox1.DisplayMember = "Name";
this.radMultiColumnComboBox1.ValueMember = "Id";
this.radMultiColumnComboBox1.DataSource = collectionOfStudents;
this.radMultiColumnComboBox1.AutoCompleteMode = AutoCompleteMode.Append;
}
public class Student
{
int m_id;
string m_name;
string m_grade;
public Student(int m_id, string m_name, string m_grade)
{
this.m_id = m_id;
this.m_name = m_name;
this.m_grade = m_grade;
}
public int Id
{
get
{
return m_id;
}
set
{
m_id = value;
}
}
public string Name
{
get
{
return m_name;
}
set
{
m_name = value;
}
}
public string Grade
{
get
{
return m_grade;
}
set
{
m_grade = value;
}
}
}Type "David" in the editor and hit Backspace:
Expected: every Backspace hitting should delete the last character:
Actual: it is not possible to delete the text:
Workaround:
this.radMultiColumnComboBox1.AutoCompleteMode = AutoCompleteMode.Suggest;
Use attached to reproduce.
Any chance for an updated MCCB with EL like the new Textboxes?
Thanks,
_D
To reproduce use the following code snippet and press the Enter key on group header row:
public RadForm1()
{
InitializeComponent();
GroupDescriptor descriptor = new GroupDescriptor();
descriptor.GroupNames.Add("CategoryName", ListSortDirection.Ascending);
this.radMultiColumnComboBox1.EditorControl.GroupDescriptors.Add(descriptor);
this.radMultiColumnComboBox1.EditorControl.EnableGrouping = true;
this.radMultiColumnComboBox1.EditorControl.ShowGroupedColumns = true;
}