m having a winForm and in that m using BackGroundWorker
control for keeping Form GUI active.
Now i'm accessing datagridview from backgroundworker_doWork()
method, so i created a delegate method below:
delegate void updateGridDelegate();
private void invokeGridControls()
{
if (autoGridView.InvokeRequired)
{
updateGridDelegate delegateControl = new updateGridDelegate(invokeGridControls);
autoGridView.Invoke(delegateControl);//here i need to do something to access autoGridView.Rows.Count
}
}
and in the backgroundworker_DoWork()
event m accessing datagridview as
int temp2noofrows = autoGridView.Rows.Count - 1;// here i dn't understand how to call my delegate method, so i can avoid cross threading access error