1114
nodyang@aliyun.com 5 days ago
parent 61c30d2bd7
commit ea4d400eab

@ -73,13 +73,21 @@ namespace RfidWeb.Frm
});
}
this.Invoke(() =>
{
try
{
int currentFirstVisibleRowIndex = dataGridView1.FirstDisplayedScrollingRowIndex;
this.dataGridView1.DataSource = lsList;
if (currentFirstVisibleRowIndex >=0 && currentFirstVisibleRowIndex < dataGridView1.Rows.Count)
if (currentFirstVisibleRowIndex >= 0 && currentFirstVisibleRowIndex < dataGridView1.Rows.Count)
{
dataGridView1.FirstDisplayedScrollingRowIndex = currentFirstVisibleRowIndex;
}
}
catch (Exception e)
{
Console.WriteLine(e);
}
});
}
@ -98,6 +106,8 @@ namespace RfidWeb.Frm
});
}
this.Invoke(() =>
{
try
{
int currentFirstVisibleRowIndex = dataGridView2.FirstDisplayedScrollingRowIndex;
this.dataGridView2.DataSource = lsList;
@ -105,6 +115,11 @@ namespace RfidWeb.Frm
{
dataGridView2.FirstDisplayedScrollingRowIndex = currentFirstVisibleRowIndex;
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
});
}

Loading…
Cancel
Save