To reproduce: please refer to the attached sample project and try to enter some numeric value or clear the existing one. Then open the popup. Workaround: use the custom filtering that RadGridView offers http://docs.telerik.com/devtools/winforms/gridview/filtering/custom-filtering this.radMultiColumnComboBox1.AutoFilter = true; FilterDescriptor filter = new FilterDescriptor(); filter.PropertyName = this.radMultiColumnComboBox1.DisplayMember; filter.Operator = FilterOperator.Contains; this.radMultiColumnComboBox1.EditorControl.MasterTemplate.FilterDescriptors.Add(filter); this.radMultiColumnComboBox1.EditorControl.EnableCustomFiltering = true; this.radMultiColumnComboBox1.EditorControl.CustomFiltering += EditorControl_CustomFiltering; string search = string.Empty; private void EditorControl_CustomFiltering(object sender, Telerik.WinControls.UI.GridViewCustomFilteringEventArgs e) { search = this.radMultiColumnComboBox1.MultiColumnComboBoxElement.EditorElement.Text; if (search != string.Empty) { e.Handled = true; e.Visible = e.Row.Cells[this.radMultiColumnComboBox1.DisplayMember].Value.ToString().Contains(search); } else { e.Handled = false; } }
To reproduce: - Add a GridViewMultiComboBoxColumn to a grid with wide columns. - Call the following code in the CellEditorInitialized event handler editor.EditorControl.LoadElementTree(); editor.AutoSizeDropDownHeight = true; editor.AutoSizeDropDownColumnMode = BestFitColumnMode.AllCells; editor.BestFitColumns(true, true); - The drop down still has a horizontal scrollbar. Workaround: editor.EditorControl.BestFitColumns(BestFitColumnMode.AllCells); int desiredWidth = 0; foreach (GridViewColumn column in editor.EditorControl.TableElement.ViewElement.RowLayout.RenderColumns) { desiredWidth += column.Width + editor.EditorControl.TableElement.CellSpacing; desiredWidth -= editor.EditorControl.TableElement.CellSpacing; } editor.DropDownWidth = desiredWidth + 20;//20 in case the vertical scroll appears.
To reproduce: - When the filter is set to contains the item is different than the item is selected from the drop-down and the text is taken from the append functionality. Workaround Either change the filter to StarrtsWith or remove the suggest functionality.
Use attached to reproduce: - Press button1, open the drop-down and use the mouse wheel. Workaround: class MyMultiColumnComboPopupForm : MultiColumnComboPopupForm { public MyMultiColumnComboPopupForm(PopupEditorBaseElement owner) : base(owner) { } public override bool OnMouseWheel(Control target, int delta) { return true; } } class MyMCCB : RadMultiColumnComboBox { protected override RadMultiColumnComboBoxElement CreateMultiColumnComboBoxElement() { return new MyMCCBElement(); } } class MyMCCBElement : RadMultiColumnComboBoxElement { protected override Type ThemeEffectiveType { get { return typeof(RadMultiColumnComboBoxElement); } } protected override RadPopupControlBase CreatePopupForm() { var popupForm = new MyMultiColumnComboPopupForm(this); popupForm.EditorControl.Focusable = false; popupForm.MinimumSize = this.DropDownMaxSize; popupForm.MaximumSize = this.DropDownMaxSize; popupForm.Height = this.DropDownHeight; popupForm.VerticalAlignmentCorrectionMode = AlignmentCorrectionMode.SnapToOuterEdges; popupForm.HorizontalAlignmentCorrectionMode = AlignmentCorrectionMode.Smooth; popupForm.RightToLeft = this.RightToLeft ? System.Windows.Forms.RightToLeft.Yes : System.Windows.Forms.RightToLeft.Inherit; this.WirePopupFormEvents(popupForm); return popupForm; } }
To reproduce: - Set the DropDownStyle to DropDownList
Use attached to reproduce! Workaround The column name must match the field name.
Use attached to reproduce. - There is still space at the bottom of the grid. Workaround: class MCCM : RadMultiColumnComboBox { protected override RadMultiColumnComboBoxElement CreateMultiColumnComboBoxElement() { return new MCCBElement(); } } class MCCBElement : RadMultiColumnComboBoxElement { protected override Type ThemeEffectiveType { get { return typeof(RadMultiColumnComboBoxElement);} } protected override Size GetPopupSize(RadPopupControlBase popup, bool measure) { var result = base.GetPopupSize(popup, measure); GridTableElement tableElement = this.EditorControl.TableElement; int height = 0; GridTraverser traverser = new GridTraverser(this.EditorControl.MasterView); RowElementProvider rowElementProvider = (RowElementProvider)tableElement.RowScroller.ElementProvider; while (traverser.MoveNext()) { height += (int)rowElementProvider.GetElementSize(traverser.Current).Height; height += this.EditorControl.TableElement.RowSpacing; } return new Size(result.Width, height +1); } }
Workaround: protected override void OnShown(EventArgs e) { base.OnShown(e); LightVisualElement lve = this.radMultiColumnComboBox1.MultiColumnComboBoxElement.TextboxContentElement; RadArrowButtonElement arrow = this.radMultiColumnComboBox1.MultiColumnComboBoxElement.ArrowButton; lve.MaxSize = new Size(lve.Size.Width - arrow.Size.Width - (int)arrow.Border.Width, 0); }
Workaround:
Workarond:
When you copy "Chang" and try to paste it in the editable area, it is not pasted even if the Clipboard data is a valid entry:
Me.RadMultiColumnComboBox1.DisplayMember = "ProductName"
Me.RadMultiColumnComboBox1.ValueMember = "ProductID"
Me.RadMultiColumnComboBox1.DataSource = ProductsBindingSource
Me.RadMultiColumnComboBox1.AutoCompleteMode = AutoCompleteMode.Append
Me.RadMultiColumnComboBox1.MultiColumnComboBoxElement.LimitToList = True
However, the context menu in the text box is available and you can paste even invalid value.
Please refer to the attached sample project and follow the steps from the gif file.
1) User does a search operation
2) BackgroundWorker does its task and finishes at some point, then set defaults to select the first result.
3) User selects a different result row.
4) Selected record still indicates and points to the first result.
Workaround:
Me.RadMultiColumnComboBox1.EditorControl.MasterView.TableSearchRow.AutomaticallySelectFirstResult = False
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;
}
Using AutoCompleteMode.SuggestAppend caused other issues and I changed it to Suggest.
In the example program I provided if I type in "meadows " meadows and a space I should get the following Suggested List.
SUGGESTED LIST
Meadows Green
However I get " Meadows" selected with a space at the front of the word.
Sample program that illustrates the issue can be downloaded from here: https://www.dropbox.com/s/8qxhmxai0y4w7qg/FilterMultiColumn.zip?dl=0
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;
- 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.