1

I am currently doing a C# WPF application that generates a table that does comparison reports. The table is large with formatted background, foreground, etc.

I tried to use Table within FlowDocument, but the processing was slow, and it is almost impossible to scroll. Is there any way that I can solve this issue?

I have looked at data virtualization, but couldn't find anything that is relevant to Table in FlowDocument. FYI, the FlowDocument is simply made up of a large table with numerous formated rows, and it is formed with the use of XamlReader.Load().

Any suggestions to optimize the performance will be welcomed.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Wee
  • 278
  • 4
  • 16
  • What you can do is "load on demand" means show/process only the data rows which are visible to the user when user scrolls down load the data just before the full scroll, you can check scroll bar position, when it reaches the bottom you can pull data. – MSUH Jun 06 '12 at 08:25
  • I will appreciate if you can give more information about doing this. I have looked at data virtualization, but couldn't find anything that is relevant to Table in FlowDocument. FYI, the FlowDocument is simply made up of a large table with numerous formated rows. – Wee Jun 06 '12 at 08:35
  • May be [this](http://social.msdn.microsoft.com/Forums/en/wpf/thread/ca7f539c-c770-4faa-b910-1cd07aabaf40) link to MSDN topic "Tables with many lines slow as ____" can guide you in a right direction... – Sergei Danielian Jun 06 '12 at 09:20
  • thanks gahcep for the link. I have seen it much earlier, but it wasn't helpful to me as I am writing the xaml directly and using XamlReader.Load to convert it to FlowDocument. – Wee Jun 06 '12 at 09:45
  • Have you considered a ListView GridView? Will not have as much formatting but it may have better performance. Or all the way to a raw Grid. Again limited formatting. – paparazzo Jun 06 '12 at 13:07
  • I am now considering using TextBlock within a Grid within a ScrollView. Do you think the performance will be better considering that ScollView allows data virtualisation? – Wee Jun 08 '12 at 02:00

1 Answers1

0

After exploring different alternatives, I have found rewriting the flow document to HTML to be a much better option. It takes a shorter time to load, and there is no issues with scrolling.

Wee
  • 278
  • 4
  • 16