I have a button that creates a new thread. That thread contains the following.
foreach (DataRow r in results.Rows)
{
var item = new ResultItem(this)
{
Image = r[1].ToString(),
Video = r[2].ToString(),
Title = r[3].ToString().Trim(),
Duration = r[4].ToString().Trim()
};
SearchFlow.Controls.Add(item);
}
I get this error: Controls created on one thread cannot be parented to a control on a different thread. ResItem is custom usercontrol that's part of the project, not a 3rd party control. Is there a way around this? How can I add this control to a flowtable in a new thread?