Warning: Illegal string offset 'language' in /app/wp-content/plugins/igsyntax-hiliter/classes/frontend.php on line 510
Warning: ksort() expects parameter 1 to be array, string given in /app/wp-content/plugins/igsyntax-hiliter/classes/frontend.php on line 513
Warning: Illegal string offset 'language' in /app/wp-content/plugins/igsyntax-hiliter/classes/frontend.php on line 510
Warning: ksort() expects parameter 1 to be array, string given in /app/wp-content/plugins/igsyntax-hiliter/classes/frontend.php on line 513
Warning: Illegal string offset 'language' in /app/wp-content/plugins/igsyntax-hiliter/classes/frontend.php on line 510
Warning: ksort() expects parameter 1 to be array, string given in /app/wp-content/plugins/igsyntax-hiliter/classes/frontend.php on line 513
There are 2 ways you can do this. In the first method, you can derive a class from datagrid and use the protected method GetVScroll(). In the second method, you can just do this :
- this.dataGridView1.CurrentCell = this.dataGridView1[0, rowIndex];
If you want to scroll to the bottom then do this :
- this.dataGridView1.CurrentCell = this.dataGridView1[0, this.dataGridView.Rows.count - 1];
I also found a piece of code which had a few lines (to select a row, not just scroll):
- dataGridView1.FirstDisplayedScrollingRowIndex = index;
- dataGridView1.Refresh();
- dataGrid.CurrentCell = dataGrid.Rows[index].Cells[0];
- dataGrid.Rows[index].Selected = true;