In UI for WinForms, I'm having trouble understanding how to link a RadTextBoxControl to a database containing ~ 60,000 part numbers. Obviously I don't want to fetch the whole list into RAM, I want to query the db every time the user types a character. What event do I trigger on to refresh the list, and how do I specify the query itself (search parameters, number of results returned, etc.)?
I've tried binding the .AutoCompleteDataSource to a List<string> and updating that list via the database every time the TextChanged event fires, but it doesn't work - updating the datasource doesn't re-bind to the control, and setting the property again seems to wipe out any autocomplete in progress.
Are there any code examples of using autocomplete function bound to a database?
Thanks,
Randy
I've tried binding the .AutoCompleteDataSource to a List<string> and updating that list via the database every time the TextChanged event fires, but it doesn't work - updating the datasource doesn't re-bind to the control, and setting the property again seems to wipe out any autocomplete in progress.
private void radPnTextBox_TextChanged(object sender, EventArgs e)
{
//populate autocomplete list
if (VDO != null)
{
//fetch updated list from database
PnDropdownList = VDO.GetAutoCompletePnDescription(radPnTextBox.Text.ToUpper());
//re-bind the this list by re-assigning the datasource
radPnTextBox.AutoCompleteDataSource = PnDropdownList;
}
}
Are there any code examples of using autocomplete function bound to a database?
Thanks,
Randy