1

I'm about to develop a wpf app which will be used as a planning tool. The main idea is to display a table, rows are people, columns are days. Each cell is split into two smaller cells, each smaller cell corresponds to a task assigned to the employee (the row) for the day (the column).

Should look like this :

///////////// Day 1//Day 2//Day 3//Day 4//Day 5//Day 6//Day 7

People1 E1/E2 E1/E2 E1/E2 E1/E2 E1/E2 E1/E2 E1/E2

People2 E1/E2 E1/E2 E1/E2 E1/E2 E1/E2 E1/E2 E1/E2

People3 E1/E2 E1/E2 E1/E2 E1/E2 E1/E2 E1/E2 E1/E2

I need to be able to use a customcontrol as one smaller cell (one "task").

I tried to manipulate ItemsControl, DataGrid, but everytime it was showing performance issues : either the scrolling (both horizontally and vertically) was laggy, or the time used by the app to draw the components was way too important.

As I seem to need new ideas to solve the performance issue, I was wondering if maybe someone else have had the same problem, and managed to deal with it..

Any suggestion?

LaurentH
  • 301
  • 2
  • 10
  • Have you tried to virtutalize the ItemsControl container? – Ucodia Oct 05 '11 at 12:27
  • Yes of course, the performance was better, but there still were a slight delay when refreshing the display (between 5 and 10 secs to display 40 rows, 120 columns). – LaurentH Oct 05 '11 at 12:35
  • In the Task user control, do you use styles or other resources for the brushes for example? Putting everything in styles and other resources really improves performance as styles and brushes are static by default. If virtualizing is not enough, all I can think about is a user control optimization. – Ucodia Oct 05 '11 at 12:46
  • How does your XAML look? I recently created something similar, but I only rendered the Events that existed, not every single cell. Perhaps you can adopt a similar approach? http://stackoverflow.com/questions/7435820/how-can-i-create-a-grid-with-its-x-and-y-axis-bound-to-different-collections/7444690#7444690 – Rachel Oct 05 '11 at 13:48

2 Answers2

2

ItemsControl is known to have performance problems. You can try to switch to ListBox or ListView because they are based on a VirtualizingStackPanel.

Also, the question WPF - Virtualizing an ItemsControl? has more information about virtualizing an ItemsControl.

Furthermore, it was announced at the recent Build conference that .NET 4.5 will contain considerable performance improvements to ItemsControl. Ira Lukhezo sums it up in a blog entry titled ItemsControl Performance Improvements in .NET 4.5.

Community
  • 1
  • 1
Martin Liversage
  • 104,481
  • 22
  • 209
  • 256
  • awww, no support for W2K3?? Or win XP? There goes my chance at using this in the workplace anytime soon.... – Rachel Oct 05 '11 at 14:18
0

OK if you are using DataGrid then check if ListView gives better results.

OR

I hope you are using DataGrid with DataGridTemplateColumns, if so then show the Functional Graphical E1/E2 in CellEditingTemplate and a snapshot Drawing of E1/E2 in Celltemplate. They both will look the same but Drawing based one will perform better as the Drawing is Freezable while rendering.

WPF-it
  • 19,625
  • 8
  • 55
  • 71