Scenario: We have a DataGridView that is bound to a DataAdapter (datatable), we load the data into a datatable using (adapter.fill (query, datatable)) in a separate stream (using the delegate and beginInvoke), and as soon as the data loads, we attach this data to datatable to datagridview (in main stream)
Is there a way to check if fill () is executing and cancel it.
Real scenario: The user clicks on the username and the corresponding data is loaded into the datagrid. Once a user is impatient and clicks on another user (here I want to cancel the previous fill and start a new fill)
UPDATE: We save two DataApdaters (and two DataTables), and we attach one datatable to a datagridview and start loading data into another asynchronous asynchronous. When the data is loaded, we simply bind the datagridview to the DataTable we just filled in (and start loading the previous asynchronous input). Thus, the user interface will always receive current data (without waiting for the user interface to update or freeze)
source
share