How to show more than 200 rows in TStringGrid using LiveBindings?

随声附和 提交于 2019-12-07 02:50:44

问题


I have a TDataSource that is backed by a TClientDataset bound to a TStringGrid. I did this by right-clicking on the grid, selecting "Link to DB Datasource...", and selecting the DataSource. This setup the LiveBindings for me.

When I run the application, the grid only fills with 200 rows, even though there are 5000 records in the dataset.

I'm unable to find any documentation regarding how to change the number of rows displayed or the proper way to allow the user to scroll through all of the data.

I did find the hard coded 200 value in TBindScopeDBEnumerator.Create in the unit Data.Bind.DBScope, and when I increase it to 10000, I see all 5000 rows in the grid, but this seems like a hack.

What's the proper way to show more than 200 rows in a TStringGrid?


回答1:


You need to change the TBindDBGridLink.BufferCount at designtime from -1 to whatever value you need.




回答2:


You can change the TBindDBGridLink.BufferCount for a value you want rather -1. But it's better to set the TBindDBGridLink.AutoBufferCount to True.



来源:https://stackoverflow.com/questions/8591818/how-to-show-more-than-200-rows-in-tstringgrid-using-livebindings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!