Reputation: 301
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?
Upvotes: 1
Views: 677
Reputation: 19885
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.
Upvotes: 0
Reputation: 106796
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.
Upvotes: 2