performance issue updating datatable
-
Hi. I have a datagrid on my form that has the datasource set to a datatable in a class in different project but same solution. When I change the data in the datatable, the datagrid is very long to get the changes (~2 seconds) which is not great. I use a bit complicated architechture, but it should not matter. Here's roughly what i do: _____ ClassState: DataTable MyData = new DataTable(); (Fill in dummy data) _____ ClassForm: MyGrid.DataSource = ClassState.MyData; ClassEvents.MyGetData(); _____ --> ClassEvents: DataTable temp = MyWebService.GetData(); classState.MyData.BeginLoadData(); Foreach(datarow dr in temp) { classState.MyData.ImportRow(dr); } classState.MyData.EndLoadData(); //From here and until the datagrid is updated it takes ~2 seconds. WHY?? ____________ I timed and logged every line in my code and found out that it is the datagrid that i slow on getting the updates (or the datatable that is slow sending update notifications). It has nothing to do with getting data from the webservice. Is there some way to tell the datatable to send notifications NOW??:~ Or could it have something to do with the fact that ClassState, ClassForm and Class events each is in it's own project (but same solution)? Or do you have any other ideas?:confused: