views:

224

answers:

2

Hi, I am making a small C# GUI application that reads table-like (cells, rows, columns) data from a binary file and displays it to the end user. Some files are very small (5 columns / 10 rows), but some are very big (245 columns and almost 50,000 rows).

The one and only method I found to easily display a MsExcel-like table was DataGridView. I was really happy with it when I tried the small files, but as soon as I tried with the huge one it went OOM before it even finished loading (and I had more than 4 GB of free memory).

After that though I found out its VirtualMode, and it was really fast. However unfortunately columns were no longer sortable and that is a must.

So, what can I do to obtain performance similar to DataGridView's virtual mode but have it sortable as well? (If you have another control in mind it's okay, I don't have to necessarily use DataGridView)

Also, please note that:

  • The binary files were not designed or produced by me. I have no control over their format.
  • The data is not in a database.
  • My end users shouldn't have to install a database and import the data there.
+1  A: 

Look for some third party contols. I've used Janus (www.janusys.com) and DevExpress (www.devexpress.com) for grids and they work great.

Miles
+2  A: 

You can handle the sorting by yourself and sort the datasource of datagridview with one of the "standard" sorting algorithm.

If you use List, you can use a "Sort()" method. However every collection can by sorted by yourself.

TcKs