bagaimana menunjuk row terakhir stlah di refresh pd dbgrid ?

Pemrograman Delphi

bagaimana menunjuk row terakhir stlah di refresh pd dbgrid ?

Postby aandrie77 » 16 Jun 2011, 09:02

Dear Senior,
Tlong bantuannya dong,Boleh ya......
Kan dalam DBGRID dalam delphi setelah di refresh data maka row yang terseleksi akan kembali ke posisi awal.
Bila saya menyeleksi row ke 10 trus bisa ngak bila setelah di refresh maka bisa ke row 10 lagi dan bukan ke awal (paling atas row) di DBGrid..?

Terima kasih atas perhatiannya....
aandrie77
Junior Member
 
Posts: 15
Joined: 22 Sep 2010, 14:18

RE: bagaimana menunjuk row terakhir stlah di refresh pd dbgrid ?

Postby D.E » 16 Jun 2011, 09:54

Gunakan fasilitas BookMark

var BM: TBookMark;
begin
BM := Query1.GetBookMark;
try
Query1.Reopen/Refresh/dsj;
Query1.GotoBookmark(BM);
finally
Query1.FreeBookmark(BM);
end;
end;

Atau bisa gunakan metode convensional, simpan current recno, kemudian gotorecord setelah refresh.
:idea: Dude, if you don't understand the basics and just want to get someone else write the code for you, it means you really shouldn't study computer science. Find different field!
User avatar
D.E
Senior Member
 
Posts: 638
Joined: 04 May 2010, 18:12

RE: bagaimana menunjuk row terakhir stlah di refresh pd dbgrid ?

Postby aandrie77 » 16 Jun 2011, 10:04

D.E wrote:Gunakan fasilitas BookMark

var BM: TBookMark;
begin
BM := Query1.GetBookMark;
try
Query1.Reopen/Refresh/dsj;
Query1.GotoBookmark(BM);
finally
Query1.FreeBookmark(BM);
end;
end;

Atau bisa gunakan metode convensional, simpan current recno, kemudian gotorecord setelah refresh.


Terima kasih banget...
sangat membantu.....[hr]
aandrie77 wrote:
D.E wrote:Gunakan fasilitas BookMark

var BM: TBookMark;
begin
BM := Query1.GetBookMark;
try
Query1.Reopen/Refresh/dsj;
Query1.GotoBookmark(BM);
finally
Query1.FreeBookmark(BM);
end;
end;

Atau bisa gunakan metode convensional, simpan current recno, kemudian gotorecord setelah refresh.


Terima kasih banget...
sangat membantu.....


sdh di coba tp muncul pesan
"Table does not support this operation because it is not uniquely indexed"
aandrie77
Junior Member
 
Posts: 15
Joined: 22 Sep 2010, 14:18


Who is online

Users browsing this forum: No registered users and 1 guest

cron