Completed
Last Updated: 08 Jul 2014 08:05 by ADMIN
ADMIN
Dimitar
Created on: 06 Mar 2014 11:16
Category:
Type: Bug Report
0
FIX. RadDropDownList - AutoComplete - the drop down does not display correct autocomplete items.
To reproduce:

        public Form1()
        {
            InitializeComponent();
            AddDropdownList();

            radDropDownList1.DataSource = GetTable();
            radDropDownList1.DisplayMember = "Name";
            radDropDownList1.ValueMember = "ID";

            radDropDownList1.AutoCompleteDataSource = radDropDownList1.DataSource;
            radDropDownList1.AutoCompleteDisplayMember = "Name";
            radDropDownList1.AutoCompleteValueMember = "ID";
            
            radDropDownList1.AutoCompleteMode = AutoCompleteMode.Suggest;
        }

        static DataTable GetTable()
        {
            //
            // Here we create a DataTable with four columns.
            //
            DataTable table = new DataTable();
            table.Columns.Add("ID", typeof(int));
            table.Columns.Add("Drug", typeof(string));
            table.Columns.Add("Name", typeof(string));
            table.Columns.Add("Date", typeof(DateTime));

            //
            // Here we add five DataRows.
            //
            table.Rows.Add(25, "Indocin", "David", DateTime.Now);
            table.Rows.Add(50, "Enebrel", "Sam", DateTime.Now);
            table.Rows.Add(10, "Hydralazine", "Christoff", DateTime.Now);
            table.Rows.Add(21, "Combivent", "Janet", DateTime.Now);
            table.Rows.Add(100, "Dilantin", "Melanie", DateTime.Now);
            return table;
        }
            

Workaround: do not set the AutoCompleteDataSource, AutoCompleteDisplayMember and AutoCompleteValueMember
        public Form1()
        {
            InitializeComponent();
            AddDropdownList();

            radDropDownList1.DataSource = GetTable();
            radDropDownList1.DisplayMember = "Name";
            radDropDownList1.ValueMember = "ID";

            //radDropDownList1.AutoCompleteDataSource = radDropDownList1.DataSource;
            //radDropDownList1.AutoCompleteDisplayMember = "Name";
            //radDropDownList1.AutoCompleteValueMember = "ID";
            
            radDropDownList1.AutoCompleteMode = AutoCompleteMode.Suggest;
        }
0 comments