Insert from one to another datagrid values C#

  • 55 Views
  • Last Post 3 weeks ago
Stylus STYLUS posted this 4 weeks ago

I need on same for me on double click from datagrid Roba(number, name, bar_kod) to insert that values in another datagrid1 (number, name, bar_kod) with same column names

Some help?

admin posted this 3 weeks ago

I think the best way you should add a datasource to your DataGridView

When you double click the row on the DataGridView, you can copy the current object, then add it to another DataGridView

var obj = grid1bindingsource.Current as YourObject;
(grid2bindingsource.DataSource as List<YourObject>.Add(obj);
Close