Datagridview row display
-
Is there any method I can use to jump to a particular row in a datagridview so that that row is highlighted and is displayed as if the 1st row (those rows before it would be scrolled up to be viewed)?
-
Is there any method I can use to jump to a particular row in a datagridview so that that row is highlighted and is displayed as if the 1st row (those rows before it would be scrolled up to be viewed)?
Tryed all my best but still didn't find any method or way that bring up the specific row in the DataGridView. Well, if you want to select a specific row, you can do it as follows:
DataGridView1.ClearSelection(); DataGridView1.Rows[index].Selected=true;
where index is an integer variable holding a valid value, or instead of it you can pass an integer value. The ClearSelection method will clear the previous selected row(s). Best Regards. _____________________________ Success is not something to wait for, its something to work for. -
Is there any method I can use to jump to a particular row in a datagridview so that that row is highlighted and is displayed as if the 1st row (those rows before it would be scrolled up to be viewed)?
Select it as indicated. Then, set the
FirstDisplayedScrollingRowIndex
[^] to that row. -- I've killed again, haven't I? -
Select it as indicated. Then, set the
FirstDisplayedScrollingRowIndex
[^] to that row. -- I've killed again, haven't I?Thanks Office Lineman Its solved part of my problem too. now the code would be like that:
DataGridView1.ClearSelection(); DataGridView1.Rows[index].Selected=true; DataGridView1.FirsDisplayedScrollingRowIndex=index;
Thanks and Best Regards. _____________________________ Success is not something to wait for, its something to work for. -
Thanks Office Lineman Its solved part of my problem too. now the code would be like that:
DataGridView1.ClearSelection(); DataGridView1.Rows[index].Selected=true; DataGridView1.FirsDisplayedScrollingRowIndex=index;
Thanks and Best Regards. _____________________________ Success is not something to wait for, its something to work for.Great and thanks!