I’ve got a DataGrid in my WPF/C# app that is bound to an Entity Framework collection. Each row has bound columns that change very frequently – many times per second. This causes the column to basically be unreadable because it changes so often. How can I force WPF to only show a new value every .5 seconds or 1 second even if the value changes every .1 second?
e.g.
dataGrid.MaxRefreshRate = 1000; (value in milliseconds).
I think you need to create a layer between your data and the datagrid.
Let’s assume your data is of type List< Record > and at the moment it’s bound to your DataGrid.
We’ll need some wrapper class for your data (for one row in this case). This wrapper deffers property changed and fires it regularly. Notice: I wrote this code by heart without any testing, there might (and will) be bugs. It is also not thread-safe, you need to add some locks when working with the list. But the point should be hit.
After this, just create a List< LazyRecord > from your List< Record > and use that as your datasource. Obviously it is straightforward to use a generic solution, which is much more reusable. Hope I helped a little.