How DataGridView refresh and update the data source class property run time
- From: "Ivan" <ivan.teoh@xxxxxxxxx>
- Date: 1 Aug 2006 21:11:42 -0700
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.
.
- Follow-Ups:
- Prev by Date: RE: Problem instantiating class field to null
- Next by Date: Re: Stream question. Why won't this work without close?
- Previous by thread: ContextMenuStrip - add submenu item
- Next by thread: Re: How DataGridView refresh and update the data source class property run time
- Index(es):
Relevant Pages
|