Manually Populating the DataGrid

Nov 19, 2008 at 11:02 AM

first of all I apologise if this thread has already been created, I have not managed to find it as yet.

We are currently reviewing the new DataGrid and understand its DataBinding fundamentals, however we have a case where this approach is not sufficiently performant.  Is there currently a method of populating the grid manually?

To give an idea of our situation, we have a Chart control that can conditionally display its underlying data within a DataGrid, previously we were using WindowsFormHost in conjuntion with the Forms DataGrid which was pretty quick but not so neat when resizing, moving  etc.  The Chart can display in the region of 700 TimeSeries each with at least 180 value points, which would obviously have to be shown within the DataGrid if requested.  When using the DataBound approach this is horribly slow, both for the initial display of the Grid and when scrolling vertically.

I would value any assistance using this new control.

Nov 19, 2008 at 7:12 PM
Did you try setting EnableColumnVirtualization property to true on DataGrid.
Nov 19, 2008 at 7:34 PM
Yes, EnableRowVirtualization should be true by default, and as Vamsee mentioned, you can turn on Column Virtualization by setting EnableColumnVirtualization to true.  If this doesn't solve your problem, you can try your idea of populating the grid manually by adding unbound rows and columns to the DataGrid.  This thread contains an example of how to do so:
Nov 20, 2008 at 9:57 AM

Many thanks to you both, it certainly improves performance.

I'm still getting to grips with this control...