In my C# (2010) application I have a DataGridView in Virtual Mode which holds several thousand rows. Is it possible to find out which cells are onscreen at the moment?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
I haven't tried this myself, but it seems to me that determining the rectangle of a row using DataGridView.GetRowDisplayRectangle and checking if it overlaps the current DataGridView.DisplayRectangle would be the way to go. Rectangle.IntersectsWith is useful in to do this.
As an optimization I would use DataGridView .DisplayedRowCount after finding the first visible row to determine what rows are visible.
Updated: It now finds visible cells.