Dear support,
I have an issue with a multicolumn combobox that won't close upon selection.
The first time (when it is empty) everything goes well, but the second time (in the attached video around the 10th second) it won't close the dropdown if you select the item again.
I suspect it is acting that way because I select the same item.
It is an annoying behavior because now users need to click on the little arrow to close the drop down, which is not intuitive.
I recorded a video that illustrates this issue.
Many thanks again.
Kind regards.
Peter.
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); } }
Workaround:
Workarond:
To reproduce: - Open the attached project. - Type a text so there are no results in the drop down. - Press Enter. - Click the arrow button. Workaround: private void RadMultiColumnComboBox1_DropDownOpened1(object sender, EventArgs e) { if (radMultiColumnComboBox1.Text == "") { radMultiColumnComboBox1.EditorControl.FilterDescriptors.Clear(); CompositeFilterDescriptor compositeFilter = new CompositeFilterDescriptor(); compositeFilter.FilterDescriptors.Add(new FilterDescriptor("Drug", FilterOperator.StartsWith, "")); compositeFilter.FilterDescriptors.Add(new FilterDescriptor("Name", FilterOperator.StartsWith, "")); compositeFilter.LogicalOperator = FilterLogicalOperator.Or; radMultiColumnComboBox1.EditorControl.FilterDescriptors.Add(compositeFilter); } }
To reproduce: Add a RadMultiColumnComboBox and add a DateTime column. Add a filter descriptor for the column and set the autofilter property to true. Type in the textbox and you will see abnormal behavior. Workaround: public class DTConverter : TypeConverter { public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { DateTime dt; if (DateTime.TryParse(value.ToString(), out dt)) { return dt; } return DateTime.MinValue; } public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { if (sourceType == typeof(string) || sourceType == typeof(DateTime)) { return true; } return base.CanConvertFrom(context, sourceType); } } (this.multiColumnComboBox.MultiColumnComboBoxElement.Columns["SaleDate"] as GridViewDateTimeColumn).FilteringMode = GridViewTimeFilteringMode.Date; (this.multiColumnComboBox.MultiColumnComboBoxElement.Columns["SaleDate"] as GridViewDateTimeColumn).DataTypeConverter = new DTConverter(); Telerik.WinControls.Data.FilterDescriptor oFilter = new Telerik.WinControls.Data.FilterDescriptor(); oFilter.PropertyName = this.multiColumnComboBox.DisplayMember; oFilter.Operator = Telerik.WinControls.Data.FilterOperator.IsGreaterThanOrEqualTo; this.multiColumnComboBox.EditorControl.MasterTemplate.FilterDescriptors.Add(oFilter);
Current item of RadMultiColumnComboBox is changed, when RadDock's document window position is changed.
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); }
1. Run the project and press "a" in the editable part of RadMultiColumnCombobox.
2. Press Tab. As a result you will notice that no selection will be available. If you run the project with a version prior to R2 2018 (version 2018.2.515), the selection will be kept.
Populate RadMultiColumnComboBox with data and enable the auto filter functionality. Apply a CompositeFilterDescriptor with two text columns. Try to filter entering several letters and press Tab. You will notice that the SelectedIndexChanged event is not fired in this case. However, if only one FilterDescriptor is added, not a CompositeFilterDescriptor, the selection will be properly updated.
Please refer to the attached sample project and gif file which illustrates the behavior.
Hello,
I'm facing a problem with the MulticolumnCombobox that results in an SelectedValueChanged-Event when the list is dropped down the first time after data source was set. Please use the attached project for reproducing the problem using the following steps:
==> As the MulticolumnCombobox performs different based on the culture, this seems to be a bug.
If you need further information, please do not hestitate to ask.
ADD. RadMultiColumnComboBox - add ability to display focus cues when DropDownStyle = DropDownList
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); } }
1. Create a new project and add RadMultiColumnComboBox 2. Bind it and setup filtering 3. Attach to SelectedValueChanged and SelectedIndexChanged events 4. Run the project 5. Apply some filtering and you will see that these events will not fire, regardless that the current row has changed. Work around it by using the EditorControl.CurrentRowChanged event instead of SelectedValueChanged/SelectedIndexChanged events.
Use attached to reproduce! Workaround The column name must match the field name.
To reproduce: - Set the DropDownStyle to DropDownList
To reproduce: run the attached project and refer to the attached gif file. Workaround: this.radMultiColumnComboBox1.MultiColumnComboBoxElement.TextBoxElement.TextBoxItem.TextBoxControl.MouseDown += TextBoxControl_MouseDown; private void TextBoxControl_MouseDown(object sender, MouseEventArgs e) { this.radMultiColumnComboBox1.MultiColumnComboBoxElement.TextBoxElement.TextBoxItem.TextBoxControl.SelectAll(); }
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; } }
At the moment when the control receives the focus the text gets selected. if the AllowShowFocusCues property is set to true and the DropDownStyle is set to DropDownList the focus cues should be painted similarly as in RadDropDownList this.radMultiColumnComboBox1.AllowShowFocusCues = true; this.radMultiColumnComboBox1.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
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