Hi,
I have used an ultracomboeditor to populate on the dropdown click, this is done asynchronously and when completed binds the combo's datasource and I call control.Invalidate to refresh the list, although this does not work, you have to click on the drop down twice, it works for the plain .net winforms combobox so why dosent it work for the ultracomboeditor??, I have tried everything and its really frustrating as i have used this control everywhere in my application and this is a vital change i need to do for performance.
UltraComboEditor and the inbox ComboBox control are two completely different controls with totally different implementations. So you really can't expect something like what you are doing here to work for both.
I'm not sure exactly what you are trying to do or how you are trying to do it - there's not much information here to go on, so I don't know why it's not working.
What event are you handling?
What, exactly, are you doing asynchronously?
control.Invalidate probably doesn't do anything to the list portion of UltraComboEditor, it most likely only applies to the edit portion.
If you can post a small sample project of what you are trying to do, I could take a look and see if I can tell you why it doesn't work.
I have attached an example solution.
Hi Mike,
Thanks for the quick reply, here is an example of what i was talking about, you have to click on the ultracomboeditor twice for it to refresh its values, while the plain .net object works fine. I couldn't find any way of fixing this issue..all the form has is two controls, a ultracomboeditor and a combobox, code below
public partial class Form1 : Form
{
public Form1()
InitializeComponent();
}
private void ultraComboEditor1_AfterDropDown(object sender, EventArgs e)
LoadDataTable();
private void comboBox1_DropDown(object sender, EventArgs e)
private void LoadDataTable()
BackgroundWorker bw = new BackgroundWorker();
bw.DoWork += new DoWorkEventHandler(bw_DoWork);
bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);
bw.RunWorkerAsync();
private void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
DataTable dt = e.Result as DataTable;
ultraComboEditor1.DataSource = dt;
ultraComboEditor1.ValueMember = "Value";
ultraComboEditor1.DisplayMember = "Text";
ultraComboEditor1.Invalidate();
comboBox1.DataSource = dt;
comboBox1.ValueMember = "Value";
comboBox1.DisplayMember = "Text";
comboBox1.Invalidate();
private void bw_DoWork(object sender, DoWorkEventArgs e)
DataTable dt = new DataTable();
dt.Columns.Add("Text", typeof(string));
dt.Columns.Add("Value", typeof(object));
for (int i = 0; i <= 1000; i++)
dt.Rows.Add("Value " + i.ToString(), i);
e.Result = dt;