SourceGrid 4.30 released

June 15, 2010

Sources
The sources are hosted on bitbucket.org

Main Changes

  • Improved hidden rows handling. Now vertical scroll bar does not include hidden rows while scrolling
  • Added sample 56 to show column and row spanning with sorting enabled
  • Added sample 57 to show how scrolling with hidden rows works
  • Fixed performance problem with image editing
  • Added xml documentation generation to project file. Fixed warnings.
  • Fixed spanning bugs
  • Fixed converter problem from double to string
  • Added rich text box sample
  • Fixed bug when selection resets when there is a null cell
  • Other stability improvements
  • Added experimental PingGrid with Essent, NHibernate and DataSet backends
Please feel free to contact if encounter any issues or problems, or have new ideas

I’ve read in Ayendes blog about Esent, which is an embeddable database storage engine (ISAM) which is part of Windows.

There is also a managed API being created at CodePlex. What I did is implemented a backend for SourceGrid using Esent PersistentDictionary. This is similar to windows DataGrid, which takes data from DataSet (or DataTable, or DataView) structure.

However, with DataSet there are two problems.

  • Whole data must be kept in memory. I did home-testing and found that keeping 1 million rows in DataTable increases my app memory consumption from roughlt 50MB to 250MB.
  • Data is not persistent.

Essent backend solved both of these two problems (although sorting is not available with PersistentDictionary out of the box). This image shows the result:

Of course the data is simplistic, first column is just ID, second is one of the 5 random strings. Whole esent DB file takes 674 MB on disk. There is at the moment a small problem with hidden rows implementation, but that can be fixed easily. If hidden rows feature is temporarily disabled, then the data can be viewed immediately, scrolling works just fine.

I plan to make other backends too. Probably the next one will be NHibernate backend, with embedded FireBird as an example. Hope that it will support sorting, and will handle data (at least on local computer) easily. I will try to test SourceGrid against 10 mln rows.

SourceGrid 4.22 released

December 12, 2009

SourceGrid 4.22 has been released for a while.

The most interesting changes are these:

  • QuadTree implementation for spanning cells. This improves performance 2 to 5 times when working with spanned cells. I used simple library found on codeproject.
  • Source code repository was moved away from CodePlex to BitBucket . New repository is here.

The reason for doing this is terrible support svn at CodePlex. Read more in another post. BitBucket is a site inspired by GitHub and provides Mercurial DCVS support. Hopefully this will encourage other people to experiment with this project.

Yesterday i’ve worked on SourceGrid. The goal was to create a new sample to show how SourceGrid.DataGrid performs with a data set of 1000000 (one million) rows.

I had to create an asyncrhonyous data loader. I’ve measured that 200k rows are added to System.Data.DataTable in around 4 seconds on my computer.  You can check sample number 53 and see what is the result.

Initially, there a was performance problem with selection drawing code. The problem was that if you select many rows, for example, 900k, then the selection code called the function which calculated the drawing region for it.  I used dotTrace to track down the problem. My observation was that while there were 18 calls to method “Draw”, there where almost 400k calls to get DataRowView from DataTable.

The solution was to clip the selection region with the visible area region. After that, once the DataGrid is finished populating with data, selection and drawing works like a charm.

There are still problems which asynchronous loading, however. If you try to sort a column while the grid has not finished populating, you will get an exception.

I hope this will be a nice feature for somebody ;)