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
225
UltraComboEditor - suggest/append from150k records
posted

I need to provide an auto-complete feature that suggests/appends based on 150k records.  The winform that will provide this feature will be opened around 5k times per day by 30+ users in the office.  The data is fairly volatile meaning new records get added fairly often throughout the day so I can't cache the dataset for too long without running the risk of someone not seeing recently added records, which can actually cause some legal issues in the industry we're in.

I'm wondering what's the best way to implement this feature. One idea is to handle the TextChanged event and whenever the event is triggered a DB call would be made to bring back a subset of data that matches what the user has typed upto that point and then bind that subset to the UltraComboEditor control.

Can anyone think of a more efficient way to accommodate this scenario?

Parents
No Data
Reply
  • 225
    posted

    I did some prototyping and quickly ran into a series of challenges.

    First of all I set AutoCompleteMode to SuggestAppend and set AlwaysInEditMode to true.  Then in my TextChanged event handler, I added logic to make a db call that takes as input the text entered by the user.  And then I set UltraComboEditor.DataSource to my data collection object  Lastly I called UltraComboEditor.DropDown() to force open the dropdown list.  So far so good.

    I ran my app and entered one character and the dropdown list opened and showed matching results. It seems to have worked! Then when I entered my second character it replaced the first character because apparently the combobox had automatically highlighted the first character.  After searching the forum I found a workaround and it also worked as expected.  After that I was able to enter more characters without any issue and the suggest/append worked as expected. I thought I could move on but ran into yet another challenge. When I used the up/down arrow keys to select one of the visible records that's when everything went haywire. I realized that was because as soon as I hit the up/down key to select a record the TextChanged() event fired and now the combobox would try to make suggestions based on the selected record itself....  I think I can figure out a way around this too but can anyone think of a better way? 

Children