How DataGridView refresh and update the data source class property run time

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I have a class Foo which have two property. I have a thread that do
some process and update class Foo int B. I have a datagridview on main
form. this datagridview data source to this class Foo and column A
binds to string A and column B binds to int B. When i start two
threads, the datagridview able to show two rows and updated int B at
run time. How?

public class Foo
{
public Foo()
{
}

private string a;
public string A
{
set { a = value; }
get { return a; }
}

private int b;
public int B
{
set { b = value; }
get { return b; }
}
}

I try this code, but does not work.

dataGridViewBindingSource.CurrentItemChanged += new
EventHandler(dataGridViewBindingSource_CurrentItemChanged);

void dataGridViewBindingSource_CurrentItemChanged(object sender,
EventArgs e)
{
dataGridView.Refresh();
}

Anyone helps. Thanks in advance.

.



Relevant Pages