DataGridView Virtual Mode

0
0

I have linq list from database as 2 millons records , ı want to use virtual mode with linq list for performance  but ı cant do it , can you help this topic ?

Thanks

  • You must to post comments
0
0

See attached simple app.

Basically when DataGridView.VirtualMode is true, it fires the CellValueNeeded event to retrieve the value of each cell instead of keeping it in the grid. How you provide the data and cache or page depends on the data source, the architecture, etc. There are several example for the DataGridView in WinForms that you can use to implement a caching system connected to your data base and caching requirements.

For example see https://docs.microsoft.com/en-us/dotnet/desktop/winforms/controls/virtual-mode-with-just-in-time-data-loading-in-the-datagrid

Shows how to implement a Cache manager that selected from the database X rows on demand when the VirtualMode grid needs them. The class DataRetriever in the sample uses an SqlConnection but it’s easy to change to use Linq and any other data adapter.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.