c# - Why Invalidate() should be called outside the control then it can work? -
I am using C # + winforms to develop software.
I have a UserControl that has many DataGrid views in
datagridview1.datasource = dc.doctor;
I use linq to populate the datagrid view with Dataset, because I need to refresh the datasheet to update the records, so I create a new datacentext and data Allocate the source again.
The first time I found, although I reset the data source, the datagrid view can not be refreshed yet, someone tells me that I should call the invalid work on the Datagrid view, I tried to some extent, it works. But if I call invalidity within the class of the user control, then this will not work.
If I'm creating a public function on the square of the user control, then it's user control. Call with Refresher (), then it works.
Does anyone tell me what am I missing? When a call invalidates, when will it really work?
Thanks in advance!
Deactivating the work eliminates all other things like data loading ...
Comments
Post a Comment