Hi,
You can set the following two properties in Timer.Tick event.
datagridview.FirstDisplayedScrollingRowIndex
Gets or sets the index of the row that is the first row displayed on the DataGridView.
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.firstdisplayedscrollingrowindex.aspx
DataGridView.FirstDisplayedScrollingColumnIndex Property
Gets or sets the index of the column that is the first column displayed on the DataGridView.
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.firstdisplayedscrollingcolumnindex.aspx
int i = 0;
void timer1_Tick(object sender, EventArgs e)
{
i++;
int k = dataGridView1.FirstDisplayedScrollingRowIndex;
if (i % 3 == 0)
{
dataGridView1.DataSource = null;
dataGridView1.DataSource = dt01;
}
dataGridView1.FirstDisplayedScrollingRowIndex = k;
}
Best regards,
Ling Wang
Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.