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.
To reproduce: void radMultiColumnComboBox1_SelectedValueChanged(object sender, EventArgs e) { MessageBox.Show("test"); }
Workaround: Cancel CurrentRowChanging event if Text is empty: this.radMultiColumnComboBox1.EditorControl.CurrentRowChanging += EditorControl_CurrentRowChanging; void EditorControl_CurrentRowChanging(object sender, Telerik.WinControls.UI.CurrentRowChangingEventArgs e) { e.Cancel = string.IsNullOrEmpty(this.radMultiColumnComboBox1.Text) && this.radMultiColumnComboBox1.MultiColumnComboBoxElement.ArrowButton.IsPressed; }
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; }
To reproduice: 1. Add mccb and bind it: Random random = new Random(); DataTable dataTable = new DataTable(); dataTable.Columns.Add("ID", typeof(int)); dataTable.Columns.Add("Name", typeof(string)); dataTable.Columns.Add("Bool", typeof(bool)); dataTable.Columns.Add("DateColumn", typeof(DateTime)); for (int i = 0; i < 20; i++) { dataTable.Rows.Add(i, "Row " + i, random.Next(10) > 5 ? true : false, DateTime.Now.AddDays(i)); } this.radMultiColumnComboBox1.DataSource = dataTable; this.radMultiColumnComboBox1.DisplayMember = "Name"; this.radMultiColumnComboBox1.ValueMember = "Name"; 2. Add filter and subscribe to the event: radMultiColumnComboBox1.AutoFilter = true; FilterDescriptor filter = new FilterDescriptor(); filter.PropertyName = "Name"; filter.Operator = FilterOperator.Contains; this.radMultiColumnComboBox1.EditorControl.MasterTemplate.FilterDescriptors.Add(filter); radMultiColumnComboBox1.SelectedIndexChanged += radMultiColumnComboBox1_SelectedIndexChanged; void radMultiColumnComboBox1_SelectedIndexChanged(object sender, EventArgs e) { Console.WriteLine(string.Format("Row changed, current Name = {0}", radMultiColumnComboBox1.EditorControl.Rows[radMultiColumnComboBox1.SelectedIndex].Cells["Name"].Value)); } 3. Start the app the selected row is "Row 0". Type in "2", the popup will open showing rows "Row 2" and "Row 12". At this point, pressing Esc or moving the focus away from the control selected Row 2, while it shouldn't.
To reproduce: - Add bound MCCB to a form. - Open the form at design time. - Add a control to the form and resize it. - Start the application and and then close the form. - You will get the following error "The designer loader did not provide a root component but has not indicated why".
To reproduce: 1. Add a RadMultiColumnComboBox and set up filtering. 2. Start typing in order to filter all the rows. 3. Click somewhere. As a result the RadMultiColumnComboBox will loose focus. If you try to get the SelectedIndex or SelectedValue you will notice that the first row in the popup grid is current. It is expected to have no selected row as the entered text does not match any row. Workaround: public class CustomRadMultiColumnComboBox : RadMultiColumnComboBox { protected override void OnLostFocus(EventArgs e) { int currentIndex = this.SelectedIndex; base.OnLostFocus(e); this.SelectedIndex = currentIndex; } public override string ThemeClassName { get { return typeof(RadMultiColumnComboBox).FullName; } } }
To reproduce: Add a RadMultiColumnComboBox with two rows. Open the dropdown, you will see no scrollbars, open it again and scrollbars will be visible. Workaround: Use the following custom class: public class MCCB : RadMultiColumnComboBox { protected override RadMultiColumnComboBoxElement CreateMultiColumnComboBoxElement() { return new MCCBElement(); } } public class MCCBElement : RadMultiColumnComboBoxElement { protected override Size GetPopupSize(RadPopupControlBase popup, bool measure) { Size baseSize = base.GetPopupSize(popup, measure); RadScrollBarElement hScrollBarElement = this.EditorControl.TableElement.HScrollBar; baseSize.Height += (int)hScrollBarElement.ControlBoundingRectangle.Size.Height; return baseSize; } protected override Type ThemeEffectiveType { get { return typeof(RadMultiColumnComboBoxElement); } } }
To reproduce: Add a RadMultiColumnComboBox with one row. Open and close the dropdown, you will see that the scrollbars will show and hide with every openning Workaround: Use the following class: public class MCCB : RadMultiColumnComboBox { protected override RadMultiColumnComboBoxElement CreateMultiColumnComboBoxElement() { return new MCCBElement(); } } public class MCCBElement : RadMultiColumnComboBoxElement { protected override Size GetPopupSize(RadPopupControlBase popup, bool measure) { Size baseSize = base.GetPopupSize(popup, measure); RadScrollBarElement hScrollBarElement = this.EditorControl.TableElement.HScrollBar; baseSize.Height += (int)hScrollBarElement.ControlBoundingRectangle.Size.Height; return baseSize; } protected override Type ThemeEffectiveType { get { return typeof(RadMultiColumnComboBoxElement); } } }
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.
To reproduce: Add a RadMultiColumnComboBox fill it with data and set the following settings: comboBoxColumnElement.EditorControl.AutoSizeRows = true; comboBoxColumnElement.EditorControl.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; comboBoxColumnElement.EditorControl.MasterTemplate.AutoGenerateColumns = false; comboBoxColumnElement.EditorControl.ShowRowHeaderColumn = false; comboBoxColumnElement.EditorControl.ShowFilteringRow = false; comboBoxColumnElement.AutoSize = true; comboBoxColumnElement.AutoFilter = true; comboBoxColumnElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.FitToAvailableSize; comboBoxColumnElement.AutoSizeDropDownToBestFit = true; comboBoxColumnElement.DropDownMinSize = new Size(420, 150); comboBoxColumnElement.DropDownSizingMode = SizingMode.UpDownAndRightBottom; When you open the dropdown you will notice that one time the scrollbar will be on the bottom and the next time it will be on the top and so on. Workaround: comboBoxColumnElement.PopupOpened += Popup_Opened;.... Timer timer = new Timer(); private void Popup_Opened(object sender, EventArgs e) { timer.Tick += Tick; timer.Interval = 20; timer.Start(); } private void Tick(object sender, EventArgs e) { comboBoxColumnElement.EditorControl.TableElement.ScrollToRow(comboBoxColumnElement.EditorControl.SelectedRows(0)); timer.Stop(); }
To reproduce: 1.Add a RadMultiColumnComboBox and populate it with data. 2.Set the EditorControl.AllowSearchRow and the AutoSizeDropDownToBestFit properties to true . 3.When you open the drop down and try to use the search row (e.g. clicking over the arrow buttons), the drop down is closed. Workaround: Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.ProductsTableAdapter.Fill(Me.NwindDataSet.Products) Me.RadMultiColumnComboBox1.DataSource = Me.ProductsBindingSource Me.RadMultiColumnComboBox1.EditorControl.AllowSearchRow = True Me.RadMultiColumnComboBox1.AutoSizeDropDownToBestFit = True AddHandler Me.RadMultiColumnComboBox1.DropDownClosing, AddressOf RadMultiColumnComboBox1_DropDownClosing AddHandler Me.RadMultiColumnComboBox1.EditorControl.MouseDown, AddressOf EditorControl_MouseDown End Sub Private Sub RadMultiColumnComboBox1_DropDownClosing(sender As Object, args As Telerik.WinControls.UI.RadPopupClosingEventArgs) args.Cancel = shouldCancel shouldCancel = False End Sub Dim shouldCancel As Boolean = False Private Sub EditorControl_MouseDown(sender As Object, e As MouseEventArgs) Dim searchElement = Me.RadMultiColumnComboBox1.EditorControl.ElementTree.GetElementAtPoint(e.Location) If searchElement IsNot Nothing Then Dim parent = searchElement.Parent If parent IsNot Nothing AndAlso (TypeOf parent Is GridSearchRowElement Or TypeOf parent Is GridSearchCellElement) Then shouldCancel = True End If End If End Sub
To reproduce: - Create a custom cell class and try to add an RadMultiColumnComboBoxElement to its children. Workaround: public class MyMCCBElement : RadMultiColumnComboBoxElement { protected override void OnParentChanged(Telerik.WinControls.RadElement previousParent) { if (this.Parent.ElementTree != null) { base.OnParentChanged(previousParent); } } protected override Type ThemeEffectiveType { get { return typeof(RadMultiColumnComboBoxElement); } } }
workaround this.radMultiColumnComboBox1.ResetText();
To reproduce: 1. Open the Telerik Examples application (Quick Start Framework) 2. Go to the MultiColumnComboBox example 3. Enter partial text into the box 4. Click on title to lose focus. You will see that the text will be not cleared. When use Tab key, the text will be cleared.
To reproduce: use the following code: private void Form1_Load(object sender, EventArgs e) { this.productsTableAdapter.Fill(this.nwindDataSet.Products); this.radMultiColumnComboBox1.DataSource = this.productsBindingSource; this.radMultiColumnComboBox1.DisplayMember = "ProductName"; this.radMultiColumnComboBox1.MultiColumnComboBoxElement.DropDownAnimationEnabled = false; } Follow the steps: 1.Click the arrow button. 2.Scroll to the bottom via the Mouse Wheel As a result the last 3 rows are missing. 3.Scroll to the top via the Mouse Wheel. 4.Scroll to the bottom via the Mouse Wheel As a result the 3 missing rows are now visible. Workaround: this.radMultiColumnComboBox1.MultiColumnComboBoxElement.PopupOpened+=MultiColumnComboBoxElement_PopupOpened; private void MultiColumnComboBoxElement_PopupOpened(object sender, EventArgs e) { this.radMultiColumnComboBox1.MultiColumnComboBoxElement.EditorControl.TableElement.VScrollBar.Value = this.radMultiColumnComboBox1.MultiColumnComboBoxElement.EditorControl.TableElement.VScrollBar.Maximum; }
To reproduce: Create a ListView or GridView cell element. For example: public class FilterGroupByCell : DetailListViewDataCellElement { private RadMultiColumnComboBoxElement multiColumnComboBox = new RadMultiColumnComboBoxElement(); public FilterGroupByCell(DetailListViewVisualItem owner, ListViewDetailColumn column) : base(owner, column) { } protected override void CreateChildElements() { base.CreateChildElements(); this.multiColumnComboBox.AutoSizeDropDownToBestFit = true; multiColumnComboBox.DropDownSizingMode = SizingMode.UpDownAndRightBottom; multiColumnComboBox.EditorControl.MasterTemplate.AutoGenerateColumns = false; GridViewTextBoxColumn column = new GridViewTextBoxColumn("CustomerID"); column.HeaderText = "Customer ID"; multiColumnComboBox.Columns.Add(column); column = new GridViewTextBoxColumn("ContactName"); column.HeaderText = "Contact Name"; multiColumnComboBox.Columns.Add(column); column = new GridViewTextBoxColumn("ContactTitle"); column.HeaderText = "Contact Title"; multiColumnComboBox.Columns.Add(column); column = new GridViewTextBoxColumn("Country"); column.HeaderText = "Country"; multiColumnComboBox.Columns.Add(column); column = new GridViewTextBoxColumn("Phone"); column.HeaderText = "Phone"; multiColumnComboBox.Columns.Add(column); this.Children.Add(multiColumnComboBox); } public override void Synchronize() { base.Synchronize(); this.Text = ""; if (base.Row == null) { return; } this.CurrentFilter = (MFilter)base.Row.DataBoundItem; if (CurrentFilter.CustomListRecordId == "1") multiColumnComboBox.Visibility = Telerik.WinControls.ElementVisibility.Collapsed; DataTable table1 = new DataTable("test"); table1.Columns.Add("CustomerID"); table1.Columns.Add("ContactName"); table1.Columns.Add("ContactTitle"); table1.Columns.Add("Country"); table1.Columns.Add("Phone"); table1.Rows.Add(1, "Ivan Petrov", "2", "2", "2"); table1.Rows.Add(2, "Stefan Muler", "2", "2", "2"); table1.Rows.Add(3, "Alexandro Ricco", "2", "2", "2"); multiColumnComboBox.DataSource = table1; multiColumnComboBox.DisplayMember = "ContactName"; } public MFilter CurrentFilter { get; set; } } Workaround: Create a custom RadMultiColumnComboBoxElement: public class MyRadMultiColumnComboBoxElement : RadMultiColumnComboBoxElement { protected override void OnParentChanged(Telerik.WinControls.RadElement previousParent) { if (this.IsPopupOpen) { this.ClosePopup(RadPopupCloseReason.CloseCalled); } if (this.Parent != null && this.Parent.ElementTree != null && this.Parent.ElementTree.Control is RadGridView) { base.OnParentChanged(previousParent); } } protected override Type ThemeEffectiveType { get { return typeof(RadMultiColumnComboBoxElement); } } } In order to be able to set a DataSource you need to create a new BindingContext prior setting setting the DataSource: DataTable table1 = new DataTable("test"); table1.Columns.Add("CustomerID"); table1.Columns.Add("ContactName"); table1.Columns.Add("ContactTitle"); table1.Columns.Add("Country"); table1.Columns.Add("Phone"); table1.Rows.Add(1, "Ivan Petrov", "2", "2", "2"); table1.Rows.Add(2, "Stefan Muler", "2", "2", "2"); table1.Rows.Add(3, "Alexandro Ricco", "2", "2", "2"); multiColumnComboBox.EditorControl.BindingContext = new System.Windows.Forms.BindingContext(); multiColumnComboBox.DataSource = table1; multiColumnComboBox.DisplayMember = "ContactName";
To reproduce: - add a RadMultiColumnCombo and bind it to fill with data. Use the following code: this.radMultiColumnComboBox1.EditorControl.SelectionChanged+=EditorControl_SelectionChanged; private void EditorControl_SelectionChanged(object sender, EventArgs e) { radMultiColumnComboBox1.SelectedIndex = -1; } After selecting a new row from the drop down grid, NullReferenceException is thrown.
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; } } }