Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to track the row position in flexgrid after sort performed? 1

Status
Not open for further replies.

EwS

Programmer
Dec 30, 2002
398
0
0
US
When the user selects a second row in the flexgrid, I save the .Row value (2) as well as the row ID (123).

When the user sorts by column, I want to keep 123 highlighted. However, if I highlight .Row = 2, it highlights row in position 2, which might not correspond to 123.

How do I keep track of 123 position in the grid after the sort has been performed so that I'm highlighting 123, which after the sort might be the first, not the second, row in the grid?

Thank you.
 
One approach that you might want to consider is to create an additional column in the grid with a ColWidth of 0. That will hide the column, and you could initialize it with the intial row position. Then after the sort, you could search the grid, looking in the hidden column for the original row position, and then select the appropriate row.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top