我DevExpress.XtraGrid.Views.Grid.GridView
通过 c# 在我的 WinForm 应用程序中使用,我想访问此网格的行并使用每行的 Tag 属性来保存一些数据,我该怎么做?
1 回答
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.