I have one datagridview which i fill using the connected verion of ADO.NET.
When the user presses the search button a seperate thread is created and in that thead i connect to the database and fill the datagridview.
In the fillthegrid() I will have acces the button.enable property and access the the rows for writing but since the thread is not the primary I cant access it.
How to get around this problem ?
Thanks !
When the user presses the search button a seperate thread is created and in that thead i connect to the database and fill the datagridview.
Code:
private void cmdsearch_Click(object sender, EventArgs e)
{
ThreadStart t = fillthegrid;
Thread fillthread = new Thread(t);
fillthread.Start();
}
void fillthegrid()
{
//do some stuff like disabling the search button to avoid repetitive calls
//here I connect to the database and show it in datagridview
//enabling the search button again
}
How to get around this problem ?
Thanks !
Comment