Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
25
Dynamically setting DataSource for AutoCompleteMode.Suggest
posted

Hi,

I am using UltraCombo with AutoCompleteMode.Suggest and I want to auto populate it  with data that will come from database

when user types 2 characters.

The issue I am experiencing is that Auto Suggest List is not displayed when I set DataSource after 2nd character but rather on the 3rd character.

Is there a way I can force AutoSuggest drop down list once I set DataSource?

ultraCombo.KeyUp += (sender, args) =>
{
var combo = sender as UltraCombo;
var value = combo.Text ?? "";

if (value.Length == 2)
{
combo.DataSource =
    new List<string>{
           "A",
           "AA11",
           "AA21",
           "AA31"
     };
   }

   // Force elements from DataSource to get displayed o
 };
}

When I type AA I would like to populate list and get it dysplayed, AytoComplete will be filtering list for other characters length (3,4,5....)