grid scroll bar does not ignore deleted records

Dear Friends,

I have used a grid based on a table in my form. SET DELETED is ON. When i delete all records in the table and append some blank records, after refreshing the grid, if the first row of the grid has focus, the vertical scroll bar is positioned somewhere in the middle instead of being at the top.

That means it is counting those deleted records also. How to make it to ignore deleted records?

[424 byte] By [RavindraPatil] at [2008-1-10]
# 1

You may try a "go top" before refreshing the grid...

How do you refresh grid?

dni at 2007-10-3 > top of Msdn Tech,Visual FoxPro,Visual FoxPro General...
# 2

You'll see the same thing in a simple browse window, so it's nothing to do with a grid per se. Best solution might be to base the grid on a view instead of on the table, then refresh the view after deleting and appending records.

RickBorup at 2007-10-3 > top of Msdn Tech,Visual FoxPro,Visual FoxPro General...
# 3

i use grid.refresh method to refresh.

RavindraPatil at 2007-10-3 > top of Msdn Tech,Visual FoxPro,Visual FoxPro General...
# 4

Rick,

your suggession seems to be practical. if the pob. of deleted records is not solved there is no other way out. u r right the same prob. is with the FOXPRO BROWSE window itself and so i think that this problem will remain as it is.

RavindraPatil at 2007-10-3 > top of Msdn Tech,Visual FoxPro,Visual FoxPro General...
# 5

You may try to "refresh" with:

thisform.YourGrid.RecordSource = ""

go top

thisform.YourGrid.RecordSource = YourTableName

dni at 2007-10-3 > top of Msdn Tech,Visual FoxPro,Visual FoxPro General...