database - Delete and refresh a record in DBgrid where u maintain the same position -


i have small database i'm using dbgo, have dbgrid displaying records, need know how delete record , refresh database index arrow stays in same position or @ least go next? index arrow jump start form beginning each time refresh !

just keep , reset recno

var i:integer; .......  := ads.recno; ads.delete; ads.recno := i; 

an example implementation usage dbnavigator be

procedure deleteandkeeprecno(ads: tcustomadodataset); var   rn: integer; begin   rn := ads.recno;   ads.delete;   ads.recno := rn; end;  procedure tform4.dbnavigator1click(sender: tobject; button: tnavigatebtn); begin   if button = nbdelete   begin     deleteandkeeprecno (tcustomadodataset(tdbnavigator(sender).datasource.dataset));     abort;   end; end; 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -