全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1151
推到 Plurk!
推到 Facebook!

About DBGrid

尚未結案
marker
一般會員


發表:9
回覆:5
積分:2
註冊:2004-11-05

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-01-03 12:39:13 IP:210.177.xxx.xxx 未訂閱
Hi all, How can I get the current active row number in a DBGrid? Mark Leung
Fishman
尊榮會員


發表:120
回覆:1949
積分:2163
註冊:2006-10-28

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-01-03 13:07:29 IP:210.65.xxx.xxx 未訂閱
Hi marker,    參考 http://delphi.ktop.com.tw/topic.php?topic_id=59085 http://delphi.ktop.com.tw/topic.php?topic_id=56899 1.定義一個 type
type 
  TDumDBGrid=class(TDBGrid);
2.取的目前 Row
procedure TForm1.Button2Click(Sender: TObject);
begin
  ShowMessage(IntToStr(TDumDBGrid(DBGrid1).Row));
end;
---------------------------------- 小弟才疏學淺,若有謬誤尚請不吝指教 ----------------------------------
------
Fishman
marker
一般會員


發表:9
回覆:5
積分:2
註冊:2004-11-05

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-01-03 13:58:08 IP:210.177.xxx.xxx 未訂閱
Fishman, It seems this value only show the row number of the displaying page in DBGrid, that means if the total number of row in the DBGrid is larger than this of a single page that the DBGrid can display, I will need to add a offset for this value if I need the actually row number of the record set. Is there a way to find this offset value? Mark Leung
Fishman
尊榮會員


發表:120
回覆:1949
積分:2163
註冊:2006-10-28

發送簡訊給我
#4 引用回覆 回覆 發表時間:2005-01-03 15:20:39 IP:210.65.xxx.xxx 未訂閱
Hi marker,    What kind of DataSet do you use !?    Maybe you can use DBGrid1.DataSource.DataSet.RecNo to identify actually row number of the DataSet. But it seems only work on ADO & ClientDataSet. If you use BDE as your dataset. Add DatasetProvide & ClientDataSet to solve this problem. http://delphi.ktop.com.tw/topic.php?topic_id=29579 ---------------------------------- 小弟才疏學淺,若有謬誤尚請不吝指教 ----------------------------------
------
Fishman
系統時間:2024-07-01 17:37:19
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!