pre-sort, post-sort

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

Guest

Hi again,
I've asked this question before, but I think I'd better rephrase. I've just
clicked a column header in my DataTable/DataGrid and the column is sorted.
Pre-sort, I got the file number from the File column (xFile - which doesn't
change) and the row number (row) of the highlighted row. Now, post-sort, I'm
trying to find the new row that this xFile is in. After I tell it sort, I
tell it to come here:

DataView dv = new DataView(tCat, "", "File", DataViewRowState.CurrentRows);
row = dv.Find(xFile);
if (row <= dv.Table.Rows.Count && row > -1){dg.Select(newPosition);}

Unfortunately, it doesn't find the new position of xFile, but does select
some other row. I'm not sure what to do (I've tried so many other ways,
including the currency mananger thing, but nothing works).
Help!!!!
Thanks again,
Mel
 
Oops, this should have been
if (row <= dv.Table.Rows.Count && row > -1){dg.Select(row);}
for the last line (not newPosition).
 

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

Back
Top