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).
 
Back
Top