I have dataGrid and as datasource is dataSet.Table[0] .
In my app i set datasource to dataset.tables[0] , in this moment is dataset
empty. Then user click on the button, run another (long-during) thread, and
this thread adding rows to the dataset like this:
DataRow v_row = dataSet.Table[0].NewRow;
v_row[0] = "xx";
v_row[1] = "yy";
this.Invoke(myProc,new object[] {v_row});
and myProc i delegate and shows on this:
void MYPROC (DataRow v_row)
{
dataSet.Tables[0].Rows.Add(v_row);
}
Everythink works fine, but for the first time then I fill table occurs this
behaviour:
first row is save to dataset well. Second row is save well but in this
moment is first row changed to the same value as second row. Others rows is
OK. Then I refill the table everythink is OK, this is happen only for the
first time after initiallization.
I tried everythink for the last 3 days. Can anybody please help me?
I thougt that problem is with multithreading, but i don't known where a why?
Thanks for anythink.
Jan Schustr
|