Completed
Last Updated: 26 Jan 2017 09:44 by ADMIN
ADMIN
Stefan
Created on: 02 Jul 2013 02:43
Category: MultiColumnCombo
Type: Bug Report
2
FIX. RadMultiColumnComboBox - disabling the animations (ThemeResolutionService.AllowAnimations) breaks the popup layout
To reproduce drop RadMultiColumnComboBox on a form and use the code below:

 public Form1()
        {
            InitializeComponent();

            ThemeResolutionService.AllowAnimations = false;
    
            RadMultiColumnComboBoxElement multiColumnComboElement = this.combo1.MultiColumnComboBoxElement;
            multiColumnComboElement.DropDownSizingMode = SizingMode.UpDownAndRightBottom;
            multiColumnComboElement.EditorControl.MasterTemplate.AutoGenerateColumns = false;
            multiColumnComboElement.EditorControl.AutoGenerateColumns = false;

            GridViewTextBoxColumn column1 = new GridViewTextBoxColumn("Item");
            column1.HeaderText = "Item";
            multiColumnComboElement.Columns.Add(column1);

            GridViewTextBoxColumn column2 = new GridViewTextBoxColumn("Description");
            column2.HeaderText = "Description";
            multiColumnComboElement.Columns.Add(column2);

            combo1.DisplayMember = "Description";
            combo1.ValueMember = "Item";

            this.combo1.AutoSizeDropDownToBestFit = true;
            this.combo1.DataSource = GetData();

            FilterDescriptor filter = new FilterDescriptor();
            filter.PropertyName = this.combo1.DisplayMember;
            filter.Operator = FilterOperator.StartsWith;
            this.combo1.EditorControl.MasterTemplate.FilterDescriptors.Add(filter);
            this.combo1.AutoFilter = true;
            this.combo1.MultiColumnComboBoxElement.AutoCompleteMode = AutoCompleteMode.Suggest;
            this.combo1.DropDownStyle = RadDropDownStyle.DropDown;
            this.combo1.SelectedItem = null;
        }

        private List<CustomItem> GetData()
        {
            List<CustomItem> items = new List<CustomItem>();

            for (int i = 0; i < 20; i++)
            {
                CustomItem item = new CustomItem(i, String.Format("This is item number: {0}", i.ToString()));
                items.Add(item);
            }

            return items;
        }

    }

    [Serializable]
    public class CustomItem
    {
        public int Item { get; set; }
        public string Description { get; set; }

        public CustomItem(int pItem, string pDescription)
        {
            this.Item = pItem;
            this.Description = pDescription;
        }
    }

Workaround: 
1. Enable the animations
 ThemeResolutionService.AllowAnimations = true;
or 
2. Increase the popup size by one pixel when opening:
 void multiColumnComboElement_PopupOpening(object sender, CancelEventArgs e)
        {
            RadMultiColumnComboBoxElement multiColumnComboElement = (RadMultiColumnComboBoxElement)sender;
            multiColumnComboElement.MultiColumnPopupForm.Size = new Size(multiColumnComboElement.MultiColumnPopupForm.Size.Width + 1, multiColumnComboElement.MultiColumnPopupForm.Size.Height);
        }
or 
3. Turn off the control clipping
((RadHostItem)((MultiColumnComboPopupForm)multiColumnComboElement.MultiColumnPopupForm).SizingGripDockLayout.Children[1]).ClipControl = false;
0 comments