This feature request refers to implementation of an AutoComplete mode for RadMultiColumnComboBox.
Currently it is not possible to select multiple rows in RadMultiColumnComboBox.
RadMultiColumnComboBox should support suggest and suggest-append auto-complete modes when AutoFiltering is enabled.
1. Create a new project with RadGridView and bind it. 2. Add GridViewMultiComboBoxColumn. 3. Set its DataSource to a large data set. 4. Run the project and try to show the drop down.
Currently you can filter in RadMultiColumnComboBox only by setting the AutoFilter property. Resolution: You can use the CompositeFilterDescriptors in RadMultiColumnComboBox and filter two or more columns. Please take a look at the code snippet: this.radMultiColumnComboBox1.DisplayMember = "City"; this.radMultiColumnComboBox1.AutoFilter = true; FilterDescriptor descriptor = new FilterDescriptor(this.radMultiColumnComboBox1.DisplayMember, FilterOperator.StartsWith, "Lo"); //first column FilterDescriptor descriptor2 = new FilterDescriptor("ContactName", FilterOperator.StartsWith, "Pe"); //second columns CompositeFilterDescriptor compositeFilter = new CompositeFilterDescriptor(); compositeFilter.FilterDescriptors.Add(descriptor); compositeFilter.FilterDescriptors.Add(descriptor2); compositeFilter.LogicalOperator = FilterLogicalOperator.Or; //OR between these columns this.radMultiColumnComboBox1.EditorControl.FilterDescriptors.Add(compositeFilter);
When the AutoFilter and AutoSuggest are turned the freely typed text is not preserved and the first row of grid is selected. Perhaps there should be a property that controls this.
RadMultiColumnComboBox disabled state in control default is inconsistent with RadDropDownList theme.
To reproduce: Create a create a class with Properties Id, Name, ParentId this.multiColumnComboBox.MultiColumnComboBoxElement .EditorControl.Relations.AddSelfReference(this.multiColumnComboBox.MultiColumnComboBoxElement.EditorControl.MasterTemplate, "Id", "ParentId"); this.multiColumnComboBox.DataSource = this.people; this.multiColumnComboBox.DisplayMember = "Name"; this.multiColumnComboBox.ValueMember = "Id"; this.multiColumnComboBox.AutoFilter = true; this.multiColumnComboBox.DisplayMember = "Name"; FilterDescriptor filter = new FilterDescriptor(); filter.PropertyName = this.multiColumnComboBox.DisplayMember; filter.Operator = FilterOperator.Contains; this.multiColumnComboBox.EditorControl.MasterTemplate.FilterDescriptors.Add(filter); When you open the popup exception should occur.
To reproduce: Repository commonRepository = new Repository(); public Form1() { InitializeComponent(); InitializeDropDown(); this.radMultiColumnComboBox1.DropDownMinSize = new Size(1100, 400); this.radMultiColumnComboBox1.EditorControl.ViewCellFormatting += EditorControl_ViewCellFormatting; } private void EditorControl_ViewCellFormatting(object sender, CellFormattingEventArgs e) { if (e.Row is GridViewDataRowInfo && e.CellElement is GridRowHeaderCellElement) { e.CellElement.Text = e.RowIndex.ToString(); } } public class Instrument { public string Isin { get; set; } public string Description { get; set; } public string AlphaCode { get; set; } public string MicMarketplaceCode { get; set; } public string WorpMarketPlaceDescription { get; set; } public string InstrumentType { get; set; } public string DerivateIsin { get; set; } public int Order { get; set; } } public class Repository { public BindingList<Instrument> GetInstruments() { Random rand = new Random(); BindingList<Instrument> list = new BindingList<Instrument>(); for (int i = 0; i < 80000; i++) { list.Add(new Instrument() { Isin = Guid.NewGuid().ToString(), Description = "Description" + i, AlphaCode = "Code" + i, MicMarketplaceCode = "MicCode" + i, WorpMarketPlaceDescription = "MPdescription" + i, InstrumentType = "Type" + i % 3, DerivateIsin = Guid.NewGuid().ToString(), Order = rand.Next(1, 100) }); } return list; } } public void InitializeDropDown() { var ui = TaskScheduler.FromCurrentSynchronizationContext(); Task.Factory.StartNew(() => { var result = commonRepository.GetInstruments(); return result; }).ContinueWith(res => { if (res.IsCompleted) { this.radMultiColumnComboBox1.DisplayMember = "Description"; this.radMultiColumnComboBox1.ValueMember = "Isin"; this.radMultiColumnComboBox1.AutoFilter = true; this.radMultiColumnComboBox1.DataSource = res.Result; CompositeFilterDescriptor compositeFilter = new CompositeFilterDescriptor(); FilterDescriptor code = new FilterDescriptor("Isin", FilterOperator.Contains, ""); FilterDescriptor description = new FilterDescriptor("Description", FilterOperator.Contains, ""); FilterDescriptor alphaCode = new FilterDescriptor("AlphaCode", FilterOperator.Contains, ""); FilterDescriptor micMarketplaceCode = new FilterDescriptor("MicMarketplaceCode", FilterOperator.Contains, ""); FilterDescriptor worpMarketPlaceDescription = new FilterDescriptor("WorpMarketPlaceDescription", FilterOperator.Contains, ""); FilterDescriptor instrumentType = new FilterDescriptor("InstrumentType", FilterOperator.Contains, ""); FilterDescriptor derivateIsin = new FilterDescriptor("DerivateIsin", FilterOperator.Contains, ""); compositeFilter.FilterDescriptors.Add(code); compositeFilter.FilterDescriptors.Add(description); compositeFilter.FilterDescriptors.Add(alphaCode); compositeFilter.FilterDescriptors.Add(micMarketplaceCode); compositeFilter.FilterDescriptors.Add(worpMarketPlaceDescription); compositeFilter.FilterDescriptors.Add(instrumentType); compositeFilter.FilterDescriptors.Add(derivateIsin); compositeFilter.LogicalOperator = FilterLogicalOperator.Or; this.radMultiColumnComboBox1.EditorControl.FilterDescriptors.Add(compositeFilter); this.radMultiColumnComboBox1.EditorControl.BestFitColumns(); for (int i = 0; i < this.radMultiColumnComboBox1.EditorControl.Columns.Count; i++) { var column = this.radMultiColumnComboBox1.EditorControl.Columns[i]; switch (column.Name) { case "Isin": column.HeaderText = "Header Isin"; column.Width = 120; break; case "Description": column.HeaderText = "Header Description"; break; case "AlphaCode": column.HeaderText = "Header AlphaCode"; break; case "MicMarketplaceCode": column.HeaderText = "Header MicMarketplaceCode"; break; case "WorpMarketPlaceDescription": column.HeaderText = "Header WorpMarketPlaceDescription"; break; case "InstrumentType": column.HeaderText = "Header InstrumentType"; break; case "DerivateIsin": column.HeaderText = "Header DerivateIsin"; break; case "Order": column.IsVisible = false; break; } } this.radMultiColumnComboBox1.SelectedItem = null; this.radMultiColumnComboBox1.Text = "Instrument"; this.radMultiColumnComboBox1.ForeColor = Color.Gray; this.radMultiColumnComboBox1.MultiColumnComboBoxElement.DropDownWidth = 550; } else { RadMessageBox.Show(res.Exception.Message); } }, ui); } Workaround: use custom filtering instead of CompositeFilterDescriptor: 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; private void EditorControl_CustomFiltering(object sender, GridViewCustomFilteringEventArgs e) { string searchText = this.radMultiColumnComboBox1.MultiColumnComboBoxElement.EditorElement.Text; if (searchText != string.Empty) { Instrument instrument = e.Row.DataBoundItem as Instrument; e.Handled = true; e.Visible = instrument.Isin.Contains(searchText) || instrument.Description.Contains(searchText) || instrument.AlphaCode.Contains(searchText) || instrument.MicMarketplaceCode.Contains(searchText) || instrument.WorpMarketPlaceDescription.Contains(searchText) || instrument.InstrumentType.Contains(searchText) || instrument.DerivateIsin.Contains(searchText); } }
When copy the RadMultiColumnComboBox control it pastes the underling grid as a separate control. Workaround: Place the RadMultiColumnComboBox on a UserControl, and introduce the desired settings there. Then reuse the user control in your forms.
When auto filter is enabled and filtering is applied, you cannot select the correct item by mouse.
FIX. RadMultiColumnComboBox - AutoFilter does not work in unbound mode
To reproduce: please refer to the attached sample project and refer to the screenshot. You will notice that initially, the arrow is a few pixels up. If you disable and then enable the RadMultiColumnComboBox again you will notice the difference. Workaround: private void radToggleButton1_ToggleStateChanged(object sender, Telerik.WinControls.UI.StateChangedEventArgs args) { ImagePrimitive img = this.radMultiColumnComboBox1.MultiColumnComboBoxElement.ArrowButton.FindDescendant<ImagePrimitive>(); img.Margin = new Padding(0); if (args.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On) { this.radMultiColumnComboBox1.Enabled = true; this.radMultiColumnComboBox1.MultiColumnComboBoxElement.ArrowButton.Padding = new Padding(0); } else { this.radMultiColumnComboBox1.Enabled = false; } }
Drop-down opening of RadMultiColumnComboBox delays, when the AutoSizeDropDownToBestFit property is enabled and the control is bound to more than 2000 records. Work around: this.radMultiColumnComboBox1.ValueMember = "ID"; this.radMultiColumnComboBox1.DisplayMember = "Name"; this.radMultiColumnComboBox1.DataSource = table; this.radMultiColumnComboBox1.AutoSizeDropDownToBestFit = false; this.radMultiColumnComboBox1.BestFitColumns(true, false);
Workaround: 1. Position the RadMultiColumnComboBox control and instead of setting the Dock property to Fill, anchor the it on all four sides. Alternatively: 2. Set the Dock property to Fill, but also set a MinimumSize of the column defining a height
Currently RadMultiColumnComboBox closes immediately when clicking on a checkbox cell and does not allow changing its value.
To reproduce: public Form1() { InitializeComponent(); Random r = new Random(); DataTable table = new DataTable(); table.Columns.Add("ID", typeof(int)); table.Columns.Add("Name", typeof(string)); table.Columns.Add("Bool", typeof(bool)); table.Columns.Add("DateColumn", typeof(DateTime)); for (int i = 0; i < 10; i++) { table.Rows.Add(i, "Row " + i, r.Next(10) > 5 ? true : false, DateTime.Now.AddHours(i)); } radMultiColumnComboBox1.DataSource = table; radMultiColumnComboBox1.EditorControl.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; radMultiColumnComboBox1.DropDownMinSize = new Size(500, 500); } To work around: radMultiColumnComboBox1.DropDownOpening += new Telerik.WinControls.UI.RadPopupOpeningEventHandler(radMultiColumnComboBox1_DropDownOpening); void radMultiColumnComboBox1_DropDownOpening(object sender, CancelEventArgs args) { radMultiColumnComboBox1.MultiColumnComboBoxElement.MultiColumnPopupForm.MinimumSize = new Size(500, 500); }
If one is using the AutoFilter functionality and want's to select the very first row of the filtered grid, s\he is not able to do so by the keyboard. Resolution: Selection of first row with keyboard is introduced in our KB article Use custom filtering to search in all columns of RadMultiColumnComboBox. Please take a look at the following link http://www.telerik.com/support/kb/winforms/details/use-custom-filtering-to-search-in-radmulticolumncombobox
To reproduce: - add custom RadMultiColumnComboBox as follows: class MyRadMultiColumnCombobox : RadMultiColumnComboBox { protected override void OnLoad(System.Drawing.Size desiredSize) { base.OnLoad(desiredSize); this.AutoSizeDropDownToBestFit = true; this.AutoFilter = true; FilterDescriptor filter = new FilterDescriptor(); filter.PropertyName = this.DisplayMember; filter.Operator = FilterOperator.Contains; this.EditorControl.MasterTemplate.FilterDescriptors.Add(filter); } public override string ThemeClassName { get { return typeof(RadMultiColumnComboBox).FullName; } } } - fill it with data: Random r = new Random(); DataTable table = new DataTable(); table.Columns.Add("ID", typeof(int)); table.Columns.Add("Name", typeof(string)); table.Columns.Add("Bool", typeof(bool)); table.Columns.Add("DateColumn", typeof(DateTime)); for (int i = 10; i < 100; i++) { table.Rows.Add(i, "Row " + i, r.Next(10) > 5 ? true : false, DateTime.Now.AddHours(i)); } myRadMultiColumnCombobox1.DataSource = table; myRadMultiColumnCombobox1.DisplayMember = "Name"; - add a RadTextBox and change its text when SelectedIndexChanged event fires: private void myRadMultiColumnCombobox1_SelectedIndexChanged(object sender, EventArgs e) { radTextBoxControl1.Text = myRadMultiColumnCombobox1.SelectedValue.ToString(); } Steps: 1.Type Backspace 2.Type 5 3.Click on the displayed row 'Row 15' will display in the Text Box 4.Type Backspace 5.Type 0 6.Click on the displayed row 'Row 10' should be displayed in the Text Box, but the SelectedIndexChanged event is not fired, so 'Row 15' is still displayed in the text box even though the MultiColumnComboBox appears to have now selected Row 10. Workaround: use myRadMultiColumnCombobox1.MultiColumnComboBoxElement.MultiColumnPopupForm.EditorControl.CurrentRowChanged event instead
Description: RadMultiColumnComboBox popup grid does not fill the entire height of the dropdown if the dropdown is sized to be wider than the RadMultiColumnComboBox. To reproduce: - add two RadMultiColumnComboBoxes and use the following code: public partial class Form1 : Form { public Form1() { InitializeComponent(); this.radMultiColumnComboBox1.Size = new System.Drawing.Size(172, 20); this.radMultiColumnComboBox2.Size = new System.Drawing.Size(334, 20); Load += Form1_Load; } void InitCombo(RadMultiColumnComboBox combo) { combo.EditorControl.MasterTemplate.AutoGenerateColumns = false; string filterFieldName = "Initials"; string name = "Name"; string displayFieldName = "InitialsPlusName"; combo.EditorControl.Columns.Add(new GridViewTextBoxColumn(filterFieldName) { Width = 60, HeaderText = "Initials" }); combo.EditorControl.Columns.Add(new GridViewTextBoxColumn(name) { Width = 200, HeaderText = "Name" }); combo.EditorControl.Columns.Add(new GridViewTextBoxColumn(displayFieldName) { IsVisible = false }); List<TempData> data = new List<TempData>(); for (int idx = 1; idx < 30; idx++) { data.Add(new TempData() { Id = idx, Name = idx.ToString(), Initials = idx.ToString() }); } combo.DataSource = data; combo.DisplayMember = displayFieldName; combo.ValueMember = "Id"; combo.AutoFilter = true; FilterDescriptor filter = new FilterDescriptor { PropertyName = filterFieldName, Operator = FilterOperator.StartsWith }; combo.EditorControl.MasterTemplate.FilterDescriptors.Add(filter); combo.EditorControl.MasterTemplate.EnableAlternatingRowColor = true; combo.EditorControl.ShowRowHeaderColumn = false; combo.MultiColumnComboBoxElement.DropDownAnimationEnabled = false; combo.MultiColumnComboBoxElement.DropDownWidth = 278; combo.MultiColumnComboBoxElement.DropDownHeight = 238; } void Form1_Load(object sender, EventArgs e) { InitCombo(radMultiColumnComboBox1); InitCombo(radMultiColumnComboBox2); } } public class TempData { public int Id { get; set; } public string Initials { get; set; } public string Name { get; set; } public string InitialsPlusName { get { return Initials + " " + Name; } } } Workaround: public partial class Form1 : Form { public Form1() { InitializeComponent(); this.radMultiColumnComboBox1.Size = new System.Drawing.Size(172, 20); this.radMultiColumnComboBox2.Size = new System.Drawing.Size(334, 20); Load += Form1_Load; } void InitCombo(RadMultiColumnComboBox combo) { combo.EditorControl.MasterTemplate.AutoGenerateColumns = false; string filterFieldName = "Initials"; string name = "Name"; string displayFieldName = "InitialsPlusName"; combo.EditorControl.Columns.Add(new GridViewTextBoxColumn(filterFieldName) { Width = 60, HeaderText = "Initials" }); combo.EditorControl.Columns.Add(new GridViewTextBoxColumn(name) { Width = 200, HeaderText = "Name" }); combo.EditorControl.Columns.Add(new GridViewTextBoxColumn(displayFieldName) { IsVisible = false }); List<TempData> data = new List<TempData>(); for (int idx = 1; idx < 30; idx++) { data.Add(new TempData() { Id = idx, Name = idx.ToString(), Initials = idx.ToString() }); } combo.DataSource = data; combo.DisplayMember = displayFieldName; combo.ValueMember = "Id"; combo.AutoFilter = true; FilterDescriptor filter = new FilterDescriptor { PropertyName = filterFieldName, Operator = FilterOperator.StartsWith }; combo.EditorControl.MasterTemplate.FilterDescriptors.Add(filter); combo.EditorControl.MasterTemplate.EnableAlternatingRowColor = true; combo.EditorControl.ShowRowHeaderColumn = false; combo.DropDownOpening += combo_DropDownOpening; } private void combo_DropDownOpening(object sender, CancelEventArgs args) { RadMultiColumnComboBox combo = sender as RadMultiColumnComboBox; if (combo != null) { combo.MultiColumnComboBoxElement.DropDownHeight = 238; combo.MultiColumnComboBoxElement.DropDownWidth = 278; combo.MultiColumnComboBoxElement.DropDownAnimationEnabled = false; combo.MultiColumnComboBoxElement.EditorControl.Height = 238; } } void Form1_Load(object sender, EventArgs e) { InitCombo(radMultiColumnComboBox1); InitCombo(radMultiColumnComboBox2); radMultiColumnComboBox1.MultiColumnComboBoxElement.ShowPopup(); radMultiColumnComboBox1.MultiColumnComboBoxElement.ClosePopup(); radMultiColumnComboBox2.MultiColumnComboBoxElement.ShowPopup(); radMultiColumnComboBox2.MultiColumnComboBoxElement.ClosePopup(); } } public class TempData { public int Id { get; set; } public string Initials { get; set; } public string Name { get; set; } public string InitialsPlusName { get { return Initials + " " + Name; } } }