Hi,
i wrote the code for How to scroll programmatically to a row in the DataGridView. there is no errors but i dont no whether it is working or not .how can i confirm it is working.
private void UpdateCustomerName_Load(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("data source=mars-104;initial catalog=marsweb;integrated security=true");
selectQueryString = "select * from tbl_customer";
conn.Open();
sqlDataAdapter = new SqlDataAdapter(selectQueryString, conn);
sqlCommandBuilder = new SqlCommandBuilder(sqlDataAdapter);
dataTable = new DataTable();
sqlDataAdapter.Fill(dataTable );
bindingSource = new BindingSource();
bindingSource.DataSource = dataTable;
dataGridView1.DataSource = bindingSource;
int jumptorow = 10;
if (dataGridView1.Rows.Count >= jumptorow && jumptorow >= 1)
{
dataGridView1.FirstDisplayedScrollingRowIndex = jumptorow;
dataGridView1.Rows[jumptorow].Selected = true;
}
}
Best,
Sudheep.