简体   繁体   中英

How can I Access to all rows in DevExpress GridControl?

我正在通过c#在WinForm应用程序中使用DevExpress.XtraGrid.Views.Grid.GridView ,我想访问此网格的Rows并使用每一行的Tag属性保存一些数据,我该怎么做?

My experiment shows that DevExpress's GridView does not hold special row objects for each row, like .NET's DataGridView does. To be fast and efficient on large data, it operates in virtual mode and renders each row on the fly, anytime needed. When accessing rows in the grid (using GetRow method for example), you actually get the object you originally passed to the grid's data source.

To store additional information about your data, the best option is to use a separate dictionary, keyed on row handle (index) or your own data object. You can also add an additional field in your original data object to hold the data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM