منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
[VB.NET] نقل من صف datagridview الي صف في DataGridView1اخري - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182)
+--- قسم : قسم اسئلة VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=183)
+--- الموضوع : [VB.NET] نقل من صف datagridview الي صف في DataGridView1اخري (/showthread.php?tid=44283)



نقل من صف datagridview الي صف في DataGridView1اخري - ali_ahmed12 - 09-11-22

السلام عليكم 
الفكرة عبارة عن اضغط علي زر اضافة اصناف الذي في شاشة فاتورة مشتريات تظهر شاشة بحث عن اصناف 
اريد عندما احدد صف في داتا قريد في شاشة بحث اصناف يظهر في شاشة فاتورة مشتريات في داتا قريد الي داخله 
مرفق كود الذي في زر اضافة اصناف 

كود :
       Me.DataGridView1.CurrentRow.Cells(1).Value = SEARCH_ITEMS_BUYBILL.DataGridView1.CurrentRow.Cells(1).Value
       Me.DataGridView1.CurrentRow.Cells(2).Value = SEARCH_ITEMS_BUYBILL.DataGridView1.CurrentRow.Cells(2).Value
       Me.DataGridView1.CurrentRow.Cells(3).Value = SEARCH_ITEMS_BUYBILL.DataGridView1.CurrentRow.Cells(4).Value
       Me.DataGridView1.CurrentRow.Cells(4).Value = SEARCH_ITEMS_BUYBILL.DataGridView1.CurrentRow.Cells(5).Value

(09-11-22, 10:07 PM)ali_ahmed12 كتب : السلام عليكم 
الفكرة عبارة عن اضغط علي زر اضافة اصناف الذي في شاشة فاتورة مشتريات تظهر شاشة بحث عن اصناف 
اريد عندما احدد صف في داتا قريد في شاشة بحث اصناف يظهر في شاشة فاتورة مشتريات في داتا قريد الي داخله 
مرفق كود الذي في زر اضافة اصناف 

كود :
       Me.DataGridView1.CurrentRow.Cells(1).Value = SEARCH_ITEMS_BUYBILL.DataGridView1.CurrentRow.Cells(1).Value
       Me.DataGridView1.CurrentRow.Cells(2).Value = SEARCH_ITEMS_BUYBILL.DataGridView1.CurrentRow.Cells(2).Value
       Me.DataGridView1.CurrentRow.Cells(3).Value = SEARCH_ITEMS_BUYBILL.DataGridView1.CurrentRow.Cells(4).Value
       Me.DataGridView1.CurrentRow.Cells(4).Value = SEARCH_ITEMS_BUYBILL.DataGridView1.CurrentRow.Cells(5).Value

كود :
Me.DataGridView1.CurrentRow.Cells(1).Value = DT.Rows(2).Item("item_code")
       Me.DataGridView1.CurrentRow.Cells(2).Value = DT.Rows(1).Item("item_name")
       Me.DataGridView1.CurrentRow.Cells(3).Value = DT.Rows(3).Item("item_unit")
       Me.DataGridView1.CurrentRow.Cells(4).Value = DT.Rows(4).Item("item_tklfa")



RE: نقل من صف datagridview الي صف في DataGridView1اخري - barawy - 10-11-22

اضف الزر إضافة الى شاشة البحث واضف اليه الكود النالى
*** بفرض ان نموذج الفاتوره يسمى FrmInvoice

كود :
Dim r As Integer = FrmInvoice.DataGridView1.Rows.count-1
FrmInvoice.DataGridView1.Rows.add()
FrmInvoice.DataGridView1.Rows(r).Cells(1).Value = me.DataGridView1.CurrentRow.Cells(1).Value
FrmInvoice.DataGridView1.Rows(r).Cells(2).Value = me.DataGridView1.CurrentRow.Cells(2).Value
FrmInvoice.DataGridView1.Rows(r).Cells(3).Value = me.DataGridView1.CurrentRow.Cells(4).Value
FrmInvoice.DataGridView1.Rows(r).Cells(4).Value = me.DataGridView1.CurrentRow.Cells(5).Value