Group: Forum Members
Posts: 2K,
Visits: 6.6K
|
I'm just a new user myself, but I sort of ran into this myself. Try this:
- just before you change the property that is sorted on (i.e. if you are sorting on MySortField (Sort="MySortField") and you are about to change the MySortField property), check the CurrentRowIndex and some other unique field, like the PK field.
- Set the property
- Check the CurrentRowIndex and PK field.
What I've found is that the CurrentRowIndex doesn't change, but the PK does. I.e. when you update the field that is sorted on, the data table is immediately reordered, but the current row index is unchanged. The immediate reordering makes sense, because by setting the Sort property, you need to assume that it is always sorted. The CurrentRowIndex not changing is less intuitive for me, but once I got it, I could deal with it.
I used the SeekByPrimaryKey method to get back to the record I was working on.
Hope this helps!
|