ListView 使用 LiveBindings 顯示超過 200 條記錄? |
答題得分者是:aftcast
|
bear28
一般會員 發表:44 回覆:53 積分:19 註冊:2002-09-10 發送簡訊給我 |
ListView 使用 LiveBindings 預設載入 200 條記錄,這也許是速度的考量,但當需要全部載入的的情況時,該如何做呢?只需加入下面二行代碼即可:
FDQuery1.OptionsIntf.FetchOptions.RecsMax := -1; FDQuery1.OptionsIntf.FetchOptions.AutoFetchAll := afAll; ps. 以上實測載入七萬條記錄,在 Windows 7 約要十幾秒的時間。 這是從龜山阿卍看到的資訊,非常感謝龜山阿卍.但測試後有些不懂 請問這兩行要加至何處? 在FDQuery1下FetchOptions屬性中預設已經是RecsMax := -1,AutoFetchAll := afAll. 與這兩行 FDQuery1.OptionsIntf.FetchOptions.RecsMax := -1; FDQuery1.OptionsIntf.FetchOptions.AutoFetchAll := afAll; 有不同嗎? 謝謝 |
P.D.
版主 發表:603 回覆:4038 積分:3874 註冊:2006-10-31 發送簡訊給我 |
|
bear28
一般會員 發表:44 回覆:53 積分:19 註冊:2002-09-10 發送簡訊給我 |
|
aftcast
站務副站長 發表:81 回覆:1485 積分:1763 註冊:2002-11-21 發送簡訊給我 |
http://docwiki.embarcadero.com/Libraries/XE8/en/Data.Bind.Components.TCustomBindList.BufferCount
A value of -1 indicates that the source component uses its default buffer count. For a source component of TBindScopeDB, the default buffer count is 200. Set BufferCount to a higher number in order to display more rows in the grid component.
------
蕭沖 --All ideas are worthless unless implemented-- C++ Builder Delphi Taiwan G+ 社群 http://bit.ly/cbtaiwan |
bear28
一般會員 發表:44 回覆:53 積分:19 註冊:2002-09-10 發送簡訊給我 |
謝謝...
===================引 用 aftcast 文 章=================== http://docwiki.embarcadero.com/Libraries/XE8/en/Data.Bind.Components.TCustomBindList.BufferCount A value of -1 indicates that the source component uses its default buffer count. For a source component of TBindScopeDB, the default buffer count is 200. Set BufferCount to a higher number in order to display more rows in the grid component. |
P.D.
版主 發表:603 回覆:4038 積分:3874 註冊:2006-10-31 發送簡訊給我 |
剛才查了一下uses, 這兩種寫法分別來自
FireDAC.Comp.Client (這行是 query 下直接呼叫 option的) FireDAC.Stan.Option (這行是阿卍前輩的) 不過, 接下來的source 就超出我的認知範圍了, 無法給你解釋是否兩邊下法會是一致的結果, 所以就照阿卍的下下看, 試試看下在 connect 之前, 既然有po出解法, 應該是可以的, 但在Deivce上要存那麼多筆記錄, 恐怕手機不死也半條命了吧! 而我實際操作的經驗(我是用fdtable), 透過 Datasnap 抓取後端資料庫到1000筆, 顯示到ListView(也是用Live/biding), 並沒有只出現200筆的問題
編輯記錄
P.D. 重新編輯於 2015-06-19 00:48:40, 註解 無‧
|
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |