Stringgrid visible selection not the same as actual row selected
Posted on 2006-06-04
Ok hopefully Im missing something obvious but I cant seem to spot it.
Im populating a stringgrid with a number of records (set to rowselect)
The user can then double click a row and open up another form to view more information.
When the user closes the second form it clears the previous records in the stringgrid and repopulates it so that the selected record is now moved to the top of the list.
Im calling the OnSelectCell event of the stringgird to auto select the top row (ie the record they just viewed).
My problem is the actual visual row selected still shows at the last position double clicked.
ie if the user double clicks row 5 and opens up the second form then closed, I call SelectCell of the first row various settings change to show that the first row is selected, but the visible area shown still shows row 5.
Am I missing something?