K J
K J

Reputation: 612

WPF DataGrid is very slow to bind, resize with large data (~75k) within a cell

I have a WPF DataGrid that I load with data from a SQL db. Some of the cells are filled with text up to 80k in length. Even for less than 10 rows, this makes the DataGrid very slow at binding to the data, and re-sizing or scrolling is very slow as well.

I am considering adding another property to the data objects I pull the SQL data into to have a truncated (first 30 chars or so) version of these large strings for display purposes. However I would think that this is not all that uncommon and wondered if there is a construct in the DataGrid, or a pattern, that handles this problem?

Upvotes: 2

Views: 713

Answers (1)

Magnus Johansson
Magnus Johansson

Reputation: 28325

Well, you shouldn't really put 80k of text data in a DataGrid, that's really bad design in all sorts of ways.

Add an additional column with an excerpt text, like 20 character or so, bind to that and let the user either do a mouse over or open a child window to dynamically load the complete data set.

Upvotes: 2

Related Questions