Search code examples
c#wpfdatagridcelldatasource

How do I get the datagrid row.cells value, I'm changing from winforms code to wpf?


I need to convert WinForms framework dataGridView.rows and row.Cells to dataGrid in WPF.

I have already changed the code dataGridView1.DataSource = dt; to dataGrid1.ItemsSource = dt.DefaultView for WPF and then added the dataGrid Itemsource="{Binding}" on the WPF xaml form design. The dataGrid1 displays data.

What I'm stuck at is the parameterized query insert needs these dataGrid rows(items) so I can get at the row cells?

Solved it myself :)


Solution

  • solved it, so turns out if I used EF6 and bound the table correctly assigning each datatype to match what is bound from the table it worked. You can also use SpreadsheetLight, this is way faster than interop.