I'm trying to load this combobox with a table from the database, everything works fine but it is a lot of records and it takes a minute to load. I would like to move this to a separate Thread, but I keep getting cross threading. I think the cross threading is happening b/c the combobox is on the ui thread. Does anyone know a simple way to achieve this.
Thanks Michael
private void BindComboBox()
{
SqlConnection con = Program.GetConnection;
SqlDataAdapter da = new SqlDataAdapter("SELECT ContactId, FullName FROM dbo.Contact WHERE FULLNAME IS NOT NULL", con);
DataSet ds = new DataSet();
da.Fill(ds, "dbo.Contact");
SearchBOX.ItemsSource = ds.Tables[0].DefaultView;
SearchBOX.DisplayMemberPath = ds.Tables[0].Columns["FullName"].ToString();
SearchBOX.SelectedValuePath = ds.Tables[0].Columns["ContactId"].ToString();
SearchBOX.IsEnabled = true;
}