[CLOSED] DataGridView sort in VirtualMode = true

Answered
0
0

Hi,

I have a DataGridView with about 5000 rows and I need to sort it when user clicks on Column Header. But it does not sort when VirtualMode = true. Is it a bug or it was disabled by design? What should I do to get it work together VirtualMode and sorting?

Thanks for your help,

Page

  • You must to post comments
Great Answer
0
0

In VirtualMode the rows are provided on demand by the app, so sorting is delegated to the data source: could be done in code or by the database or only for the loaded page, etc. If you get the rows from a database, I’d let the db server sort the data, if you have some sort of list, I’d use Linq.

See also:

https://docs.microsoft.com/en-us/dotnet/framework/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control

 

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.