title: Slow WPF 4 Datagrid Refresh
body: <p>I am using the WPF DataGrid component from the .NET 4 framework, it is bound to a thread safe observable collection which I found here : <a href="http://www.deanchalk.me.uk/post/Thread-Safe-Dispatcher-Safe-Observable-Collection-for-WPF.aspx" rel="nofollow">http://www.deanchalk.me.uk/post/Thread-Safe-Dispatcher-Safe-Observable-Collection-for-WPF.aspx</a></p>
  
  <p>The program is a System Admin tool which pings each IP Address in a range, if there is a response it creates an object in the collection with some details from the computer.</p>
  
  <p>The problem I am having, is poor performance. Initially, I was just updating the Collection and letting the datagrid pick up the changes. This caused an issue where the DataGrid control wasn't refreshing and showing the data unless I scrolled. </p>
  
  <p>So I added a timer to call the grids refresh method, the timer ticks every 750ms. This worked brilliantly, until I realised that the programs UI is completely unresponsive while the timer is enabled and it is scanning.</p>
  
  <p>Without the timer, performance is acceptable, without it, its terrible. I have tried several values for the timeout period (up to 2000ms) without any luck and have also made sure that my columns are fixed width (I read that autogenerated columns and widths can cause performance issues).</p>
  
  <p>The amount of Row's in the grid is about 300 - 400 with 5 columns, so its not exactly a huge grid.</p>
  
  <p>Does anyone have any suggestions of how I could get the grid to update in a timely manner when the collection behind is added to, without sacrificing performance?</p>