Currently I have a DataGridView
in my app which I fill from my Linq-to-SQL classes like so ...
/// <summary>
/// Delegate to update datagrid, fixes threading issue
/// </summary>
private void updateInfo()
{
// Linq to datagridview; display all
var query = from n in dbh.Items select n;
itemDataGridView.DataSource = query.ToList();
}
So the problem with this is every time I add new information and run this refresh, the focus of the table changes, meaning if I'm on one row it will switch me to an another one. And there is an event tied to the change of row so this causes this event to run while the list keeps refreshing.
I don't but I remember before switching to Linq-to-SQL bounded DataGridView
there was a TableAdapter
formed, and instead of altering data in the DB you would just insert using this TableAdapter
which would automatically refresh the DataGridView
in the proper way.
So I'm wondering if there is some other way I should be doing this to each that smooth refresh?