Ludovic Wagner
Ludovic Wagner

Reputation: 117

How to get the displayed rows of a DataGrid in view model in WPF

I would like to change the style of some DataGrid columns / cells (background, font weight, etc.) based on regular expressions. I have more than a few thousand rows and about 20 regular expressions to evaluate.

For the time being, I extended my model via an Enum which I evaluate in the view model via an extension method. Everything works fine but it is not efficient.

I don't really want to :

Is it possible to know the rows which are displayed in the view model in order to update them only (taking into account the scroll, window size, etc.)?

Otherwise, what would be a more efficient strategy?

Upvotes: 0

Views: 73

Answers (0)

Related Questions