ruben laureys
public partial class SnifferPanel : UserControl { public bool running = false; DataTable d; public SnifferPanel() { d = new DataTable(); d.Columns.Add("Source"); d.Columns.Add("Destination"); d.Columns.Add("UID"); d.Columns.Add("Index"); d.Columns.Add("Mode"); d.Columns.Add("Data"); InitializeComponent(); BindingSource b = new BindingSource(); b.DataSource = d; dataGridViewSniffer.DataSource = b; } public void newData(Emulator.Modulemanager.RS485Data data) { if (running) { dataGridViewSniffer.SuspendLayout(); string[] da = { data.Address, data.Address, data.Uid, data.Index, data.Mode, data.Data }; d.Rows.Add(da); dataGridViewSniffer.ResumeLayout(); } }
}