Spread的音效模擬模式Virtual Mode

來源:互聯網
上載者:User

音效模擬模式也就相當於自動分頁,將大量資料分次讀取,不用一次性全部裝入表格,如果資料量大的話,速度可以得到明顯的提升,尤其是spread本身裝資料就比datagrid等慢。

在設計器中直接開啟比較方便,一般情況下,我將Virtual Max,Max Virtual Rows,Rows Per Read三個參數分別設1000000,100,20。

設定完成後,記的一定不用再使用spread.datarowcnt來提取最大行,因為我習慣於使用 spread.maxrow=spread.datarowcnt來刪除多餘的行。但開啟virtual mode後,這個值取出來總是0。

然後如果用代碼來開啟,可以這樣

' Set the number of rows or records in the data source
' Use -1 when the number of records is unknown
fpSpread1.VirtualMaxRows = 1000000
' Set the max number of rows or records to keep in memory
fpSpread1.VirtualOverlap = 100
' Set the number of rows or records to read when additional data is requested
fpSpread1.VirtualRows = 10
' Enable virtual mode
fpSpread1.VirtualMode = True
' Reflect the number of rows in the virtual buffer and not the max number of rows or records
fpSpread1.VirtualScrollBuffer = True
' Enable special virtual scroll bars
fpSpread1.VScrollSpecial = True
fpSpread1.VScrollSpecialType=VScrollSpecialNoPageUpDown 

在使用過程中,我發現如果將virtualmaxrows手工設成一個值後,再改回-1時總是儲存不住,不知道算不算一個BUG。而1000000是預設值,應該等同於-1。

還有一個問題,如果開啟了特殊的捲軸後,一定不要開啟home和end兩個按鈕,反正在我用的時候,一但按完end,再按home鍵,機子立刻死翹翹。事實上,如果有上千條記錄,也不可能去來回翻看,捲軸也是可有可無的東西了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.