C# Thinking outside the norm

Introduction Had a forum question today where a developer wanted to load a TreeView in Windows Forms were data was read from a database and in turn caused the user interface to become unresponsive. They asked about BackGroundWorker component or asynchronous way (async/await task) but had never worked with any of these. My solution Since the idea is to use a delegate/event this path will work on any control ranging from TreeView to ListView or DataGridView the example given uses a ListView. Start off with a class which represents returning data. using System; namespace IteratingCodeSample.Classes { public class Countries { public int CountryIdentifier { get ; set ; } public string Name { get ; set ; } ...