PASSING VALUE OF DATAGRIDVIEW TO OTHER FORM DATAGRIDVIEW IN VB.NET
What I have tried:
Try
Dim dt2 As New DataTable
dt2.Columns.Add("Metal", Type.GetType("system.string"))
dt2.Columns.Add("Discription", Type.GetType("system.string"))
dt2.Columns.Add("Huid", Type.GetType("system.string"))
dt2.Columns.Add("Hsn", Type.GetType("system.string"))
dt2.Columns.Add("Qty", Type.GetType("system.string"))
dt2.Columns.Add("Unit", Type.GetType("system.string"))
dt2.Columns.Add("GrossWt", Type.GetType("system.string"))
dt2.Columns.Add("StoneWt", Type.GetType("system.string"))
dt2.Columns.Add("NetWt", Type.GetType("system.string"))
dt2.Columns.Add("Wastage", Type.GetType("system.string"))
dt2.Columns.Add("Rate", Type.GetType("system.string"))
dt2.Columns.Add("Mc", Type.GetType("system.string"))
dt2.Columns.Add("Amount", Type.GetType("system.string"))
For Each Row As DataGridViewRow In datagriditemdiscrib.Rows
For i As Integer = 0 To datagriditemdiscrib.Rows.Count - 2 Step +1
dt2.Rows.Add(Row.Cells(0).Value, Row.Cells(1).Value, Row.Cells(2).Value, Row.Cells(3).Value, Row.Cells(4).Value, Row.Cells(5).Value, Row.Cells(6).Value, Row.Cells(7).Value, Row.Cells(8).Value, Row.Cells(9).Value, Row.Cells(10).Value, Row.Cells(11).Value, Row.Cells(12).Value)
Next
Next
Catch ex As Exception
MsgBox(ex.Message)
End Try
Invoice_print.Show()
Invoice_print.datagriditemdiscrib_print.DataSource = dt2