I am having an issue with the UltraCombo. I have an UltraCombo that has it's datasource as a Generic List of IEnumerable when it loads. Later a user can delete one of the items that the combobox has in it's orginal list. I update the list with the item removed and try to give the UltraCombo the new datasource. It still has all of the orginal values. Below is the code that I have been using. Any help appreciated.
Code to populate.
foreach (TraxView.AgTrax.Gui_saveprompt prompts in promptlist)
{
promptcblist.Add(prompts.Listboxentry.ToString());
}
cboPromptSelect.DataSource = promptcblist;
cboPromptSelect.SetInitialValue(promptcblist.First(), promptcblist.First().ToString());
promptcblist = null;
Code to refresh datasource for UltraCombo
cboPromptSelect.DataSource = null;
cboPromptSelect.Refresh();
cboPromptSelect.DataSource = newcomboitems;
Hi,
I can't see any reason how setting the DataSource to null and then to a new DataSource could possibly hold onto the old values from the old list. Are you certain that your new list doesn't contain the old values by accident?
The Combo won't refresh it's list if you set the DataSource to the same object reference to which it was already set, of course. But since you are setting it to null here, that cannot possibly be the case.
If you can post a sample of this behavior, I'd be happy to take a look at it.
I am certain that the list I hand to the combobox to repopulate has only 2 records and not the 3 that is originally in it. I will get you a sample app quickly since this is a major pain point.