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
580
UltraCombo not accepting updated datasource
posted

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;

cboPromptSelect.Refresh();

 

 

Parents
  • 469350
    Offline posted

    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.

Reply Children
No Data