A large number of records can be quickly output to the DataGridView.
Below is an example in which 500 thousand lines are output and a new record is added to the log every 50 ms.

// Microsoft (R) Roslyn C# Compiler version 1.1.0.51204 #r "System.Windows.Forms" using System.Windows.Forms; static DataGridView LogView(int columns) { var g = new DataGridView() { Dock = DockStyle.Fill, RowHeadersVisible = false, ColumnHeadersVisible = false, AutoGenerateColumns = false, AllowUserToAddRows = false, AllowUserToDeleteRows = false, GridColor = System.Drawing.Color.WhiteSmoke, AllowUserToResizeRows = false, VirtualMode = true }; for (var i=0; i < columns; i++) g.Columns.Add("c" + i, ""); g.Columns[columns-1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; return g; }
class LogRow { public int RowId; public object Data; } var logui = LogView(2); // по-запросу возвращаем значения, необходимые для вывода в ui logui.CellValueNeeded += (s, e) => { var row = log[e.RowIndex]; switch(e.ColumnIndex) { case 0: e.Value = row.RowId; break; case 1: e.Value = row.Data; break; } }; var f = new Form() { Width = 800, Height = 300 }; f.Controls.Add(logui); // загружаем 500 тыс. записей var log = Enumerable .Range(0, 500000) .Select(i => new LogRow { RowId = i, Data = DateTime.Now.Ticks }) .ToList(); logui.RowCount = log.Count; // добавляем новую запись каждый 50 ms new Timer() { Interval = 50, Enabled = true }.Tick += delegate { log.Add(new LogRow { RowId = logui.RowCount, Data = DateTime.Now.Ticks }); logui.RowCount++; f.Text = "LOG: " + logui.RowCount; }; f.ShowDialog();
To compile the code and run the application, for example, in Visual Studio Community 2015, you need to open View - Other Windows - C# Interactive , copy the code into it and press Enter .
Visual Studio Community 2015 is a free version, you can download it here .