private void clearButton_Click(object sender, EventArgs e) { while (_displayPackets.Count > 0) { var firstItem = _displayPackets.Dequeue(); DGV.RemoveObject(firstItem); } }
private void DGVUpdate(IPDisplayPacket packet) { // Remove rows if there are too many if (DGV.Items.Count > _maxBuffer) { var firstItem = _displayPackets.Dequeue(); DGV.RemoveObject(firstItem); } _displayPackets.Enqueue(packet); DGV.AddObject(packet); }