Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

checked listview itens to the grid as newrows in between other rows(bound datagrid)

$
0
0

Hy, I´m having difficulties on taking the checked values from the listview to the datagrid.

those listview lines should be inserted bellow another one, like its another item...

C#, SQL, bounded grid

I have got this far :

private void btnReservarPredio_Click(object sender, EventArgs e)
        {
            dgvCadEvento.AllowUserToAddRows = true;
            dgvCadEvento.BeginEdit(true);

            foreach (var item in listView1.SelectedItems.ToString())
            {
                
                DataRow addrow = bdVestibulinhoDataSet.evento.NewRow();
                addrow[2] = item;
                bdVestibulinhoDataSet.evento.Rows.InsertAt(addrow, 2);

            }

        }

it almost do what I want, but it creates 60 rows, not with the listview values


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>