I'm creating a download manager, and my WPF datagrid is bound to a collection of objects representing ongoing downloads (in separate threads). When I have multiple downloads running, each one is using this code to update its datagrid item every second:
if (DateTime.Now > download.LastUpdateTime.AddSeconds(1))
{
this.downloadsGrid.Items.Refresh();
download.LastUpdateTime = DateTime.Now;
}
Datagrid.Items.Refresh() does the job, but it reconstructs the whole datagrid, causing all downloads to update each others datagrid rows several times in one second, and I don't want that kind of behavior. Is there any way to refresh a specific row (item) in a datagrid?