Unplanned
Last Updated: 30 Mar 2016 09:31 by ADMIN
ADMIN
Stefan
Created on: 16 Apr 2013 07:59
Category: MultiColumnCombo
Type: Bug Report
1
FIX. RadMultiColumnComboBox - AutoSizeDropDownToBestFit does not set the correct width to the popup
To reproduce:
 public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            Random r = new Random();
            DataTable table = new DataTable();
            table.Columns.Add("ID", typeof(int));
            table.Columns.Add("Name", typeof(string));

            for (int i = 0; i < 10; i++)
            {
                table.Rows.Add(i, "Row with longer value " + i);
            }

            radMultiColumnComboBox1.DropDownOpening += radMultiColumnComboBox1_DropDownOpening;
            radMultiColumnComboBox1.AutoSizeDropDownToBestFit = true;
            radMultiColumnComboBox1.DataSource = table;
        }

        void radMultiColumnComboBox1_DropDownOpening(object sender, CancelEventArgs args)
        {
         //  radMultiColumnComboBox1.BestFitColumns();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Random r = new Random();
            DataTable table = new DataTable();
            table.Columns.Add("ID", typeof(int));
            table.Columns.Add("Name", typeof(string));

            for (int i = 0; i < 10; i++)
            {
                table.Rows.Add(i, "Row " + i);
            }

            radMultiColumnComboBox1.DataSource = table;

        }
    }

WORKAROUND: call the BestFitColumns method in the DropDownOpening event
0 comments