DataGrid: Setting the first visible row

G

Guest

Hi people,

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

Thanks,
Tom T.
 
M

Mohamoss

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
 
G

Guest

Mohamoss said:
dataGrid1.CurrentRowIndex=(100);
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

It works like a charm, thanks.
 
G

Guest

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top