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.

Select dc.doctor from datagridview1.datasource = p;

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

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -