DataGrid: Setting the first visible row

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi people,

How can I set a certain row as the first visible row in a DataGrid?

Thanks,
Tom T.
 
Hi Tom
Get the index of the row that you want( this can be done by many means and
depends on your logic ) lets say it was row 100 . then try these two lines
dataGrid1.CurrentRowIndex=(100);
dataGrid1.Select(100);
hope that helps
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Mohamoss said:
dataGrid1.CurrentRowIndex=(100);
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

It works like a charm, thanks.
 
Hi ,
I'm having the same problem...
-Zelma
Elliot said:
Thanks!
I was just setting the CurrentRowIndex, and the datagrid would still remain on the currently selected row.
Just as a test, I tried using only the DataGrid.Select() method, and it didn't work.
I wonder why you need to use both statements to select a row?
 
Back
Top