Insert from one to another datagrid values C#

  • 935 Views
  • Last Post 22 November 2018
Stylus STYLUS posted this 18 November 2018

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 22 November 2018

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