hi i have a datagridview showing the data from a database. Now i have a problem because i want the selected row from the datagridview to be shown on another datagridview near it on button click.
I managed to make it from datagridview to listbox but from datagridview to listbox no. can anyone help me pls thanks.
here is the add for the method to be shown on the datagridview2
public void AddtoBill(DataGridView dgv)
{
DataGridViewRow row = dgv.SelectedRows[0];
int a = row.Cells[0].Value.ToString());
int b = row.Cell[1].Value.ToString());
if (!row.IsNewRow)
{
//listBox1.Items.Add(a + b);
datagridview2.row.add(a + b);
}
}