منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : نقل من صف datagridview الي صف في DataGridView1اخري
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
السلام عليكم 
الفكرة عبارة عن اضغط علي زر اضافة اصناف الذي في شاشة فاتورة مشتريات تظهر شاشة بحث عن اصناف 
اريد عندما احدد صف في داتا قريد في شاشة بحث اصناف يظهر في شاشة فاتورة مشتريات في داتا قريد الي داخله 
مرفق كود الذي في زر اضافة اصناف 

كود :
       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")
اضف الزر إضافة الى شاشة البحث واضف اليه الكود النالى
*** بفرض ان نموذج الفاتوره يسمى 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