تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
المساعدة في إيجاد حل كود للجريدفيو مرفق مثال
#1
الأخوة الافاضل في منتدى فيجول بيسك لكل العرب
أرجو المساعدة

السلام عليكم

مرفق لكم جزء من المشروع الخاص ارجو مساعدتي في كيفيه استخدام الـ DataGrid 
من خلال إضافة الاكواد المطلوبة في الصورة المرفقة على المشروع


مع أطيب تحياتي


الملفات المرفقة صورة/صور
   

.rar   WindowsApp27.rar (الحجم : 62.27 ك ب / التحميلات : 30)
الرد }}}
تم الشكر بواسطة:
#2
PHP كود :
       For r As Integer 1 To 100
            d
.Rows.Add(r.ToString)
 
       Next
        Dim i 
As Integer 0
        For r 
As Integer 0 To d.Rows.Count 1
            i 
+= Val(d.Rows(r).Cells(0).Value)
 
       Next
        d
.Rows.Add("Total: " i.ToString
الرد }}}
تم الشكر بواسطة: السيد الجوهري , بيسك لكل العرب
#3
اخي سعود بارك الله فيك وجزاك الله الف خير ولكن الكود يعطي معي خطاء ياريت تطبيقه علي كل الاعمدة في المتال المرفق في حالة عرض الفورم وفي حالة البحث بين تارخين واسف علي تعبك وربي يجازيك كل الخير
الرد }}}
تم الشكر بواسطة:
#4
هذا  الكلاس فوورم  بالكامل   أنسخ والصق فقط 

كود :
Imports System.Data.OleDb
Public Class Form1
   Dim ConStr As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\db.accdb"
   Dim Conn As New OleDbConnection(ConStr)
   Dim da As New OleDbDataAdapter
   Dim dt As New DataTable
   Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
       dt.Clear()
       da = New OleDbDataAdapter("Select * from AAA", Conn)
       da.Fill(dt)
       DataGridView1.DataSource = dt
        DataGridView1.Columns(0).Visible = False


        Compute(DataGridView1)
    End Sub

    Private Sub B2DatesFind_Btn_Click(sender As Object, e As EventArgs) Handles B2DatesFind_Btn.Click
        Dim dtp1 As Date = DateTimePicker_from.Value
        Dim dtp2 As Date = DateTimePicker_to.Value
        dt.Clear()
        da = New OleDbDataAdapter("Select * from AAA where Date >= #" & dtp1.Year & "/" & dtp1.Month & "/" & dtp1.Day & "# and Date <= #" & dtp2.Year & "/" & dtp2.Month & "/" & dtp2.Day & "# order by Date ", Conn)
        da.Fill(dt)
        DataGridView1.DataSource = dt
        Conn.Close()

        TextBox1.Text = (From row In DataGridView1.Rows Select CDbl(row.Cells(2).Value)).Sum()
    End Sub






    Private Sub Compute(ByVal Dgv As DataGridView)

        Dgv.Rows(Dgv.Rows.Count - 1).Cells(1).Value = "Total Is "
        Dgv.Rows(Dgv.Rows.Count - 1).Cells(1).Style.BackColor = Color.Black
        Dgv.Rows(Dgv.Rows.Count - 1).Cells(1).Style.ForeColor = Color.Gold

        Dim rw1 = From theRow As DataGridViewRow In Dgv.Rows
                  Where theRow.Cells(2).FormattedValue <> String.Empty
                  Select theRow


        Dgv.Rows(Dgv.Rows.Count - 1).Cells(2).Value = rw1.Sum(Function(x As DataGridViewRow) x.Cells(2).Value)


        Dim rw2 = From theRow As DataGridViewRow In Dgv.Rows
                  Where theRow.Cells(3).FormattedValue <> String.Empty
                  Select theRow


        Dgv.Rows(Dgv.Rows.Count - 1).Cells(3).Value = rw2.Sum(Function(x As DataGridViewRow) x.Cells(3).Value)


        Dim rw3 = From theRow As DataGridViewRow In Dgv.Rows
                  Where theRow.Cells(4).FormattedValue <> String.Empty
                  Select theRow


        Dgv.Rows(Dgv.Rows.Count - 1).Cells(4).Value = rw3.Sum(Function(x As DataGridViewRow) x.Cells(4).Value)

    End Sub

End Class
Abu Ehab : Microsoft Partner  & Systems Developer
 Youtube   Facebook    Twitter   
الرد }}}
تم الشكر بواسطة: بيسك لكل العرب
#5
(05-03-18, 11:46 AM)Abu Ehab كتب : هذا  الكلاس فوورم  بالكامل   أنسخ والصق فقط 

كود :
Imports System.Data.OleDb
Public Class Form1
   Dim ConStr As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\db.accdb"
   Dim Conn As New OleDbConnection(ConStr)
   Dim da As New OleDbDataAdapter
   Dim dt As New DataTable
   Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
       dt.Clear()
       da = New OleDbDataAdapter("Select * from AAA", Conn)
       da.Fill(dt)
       DataGridView1.DataSource = dt
        DataGridView1.Columns(0).Visible = False


        Compute(DataGridView1)
    End Sub

    Private Sub B2DatesFind_Btn_Click(sender As Object, e As EventArgs) Handles B2DatesFind_Btn.Click
        Dim dtp1 As Date = DateTimePicker_from.Value
        Dim dtp2 As Date = DateTimePicker_to.Value
        dt.Clear()
        da = New OleDbDataAdapter("Select * from AAA where Date >= #" & dtp1.Year & "/" & dtp1.Month & "/" & dtp1.Day & "# and Date <= #" & dtp2.Year & "/" & dtp2.Month & "/" & dtp2.Day & "# order by Date ", Conn)
        da.Fill(dt)
        DataGridView1.DataSource = dt
        Conn.Close()

        TextBox1.Text = (From row In DataGridView1.Rows Select CDbl(row.Cells(2).Value)).Sum()
    End Sub






    Private Sub Compute(ByVal Dgv As DataGridView)

        Dgv.Rows(Dgv.Rows.Count - 1).Cells(1).Value = "Total Is "
        Dgv.Rows(Dgv.Rows.Count - 1).Cells(1).Style.BackColor = Color.Black
        Dgv.Rows(Dgv.Rows.Count - 1).Cells(1).Style.ForeColor = Color.Gold

        Dim rw1 = From theRow As DataGridViewRow In Dgv.Rows
                  Where theRow.Cells(2).FormattedValue <> String.Empty
                  Select theRow


        Dgv.Rows(Dgv.Rows.Count - 1).Cells(2).Value = rw1.Sum(Function(x As DataGridViewRow) x.Cells(2).Value)


        Dim rw2 = From theRow As DataGridViewRow In Dgv.Rows
                  Where theRow.Cells(3).FormattedValue <> String.Empty
                  Select theRow


        Dgv.Rows(Dgv.Rows.Count - 1).Cells(3).Value = rw2.Sum(Function(x As DataGridViewRow) x.Cells(3).Value)


        Dim rw3 = From theRow As DataGridViewRow In Dgv.Rows
                  Where theRow.Cells(4).FormattedValue <> String.Empty
                  Select theRow


        Dgv.Rows(Dgv.Rows.Count - 1).Cells(4).Value = rw3.Sum(Function(x As DataGridViewRow) x.Cells(4).Value)

    End Sub

End Class

السلام عليكم 
مشكور أخي ابو ايهاب وجزاك الله الف خير كود الجمع شغال تمام  بس ممكن تطويره
ليشمل جميع الاعمدة الموجودة حتي لا يتم تكرار الكود لان يوجد لدي عدة أعمدة 

ولك من جزيل الشكر والعرفان

PHP كود :
Dim rw1 From theRow As DataGridViewRow In Dgv.Rows
                  Where theRow
.Cells(2).FormattedValue <> String.Empty
 
                 Select theRow

        Dgv
.Rows(Dgv.Rows.Count 1).Cells(2).Value rw1.Sum(Function(As DataGridViewRowx.Cells(2).Value
الرد }}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  ارجو المساعدة فى شاشة طباعة الباركود new_programer 10 577 09-01-24, 08:41 PM
آخر رد: new_programer
  المساعدة - في تفعيل نسخة VB 2015 emamtron2014 2 5,103 24-12-23, 05:08 AM
آخر رد: laban
  [نقاش] أساتذتنا مشرفى المنتدى المساعدة و الدعم فى Telerik dr.programming 6 381 21-12-23, 12:29 AM
آخر رد: dr.programming
  [SQL] يوجد لدى خطأبرمجى ارجو المساعدة عاصم النجار 6 503 26-07-23, 05:22 PM
آخر رد: عبد الخالق
  اخوانى الاحباب ارجو المساعدة فى كود النسخ واللصق mhareek 1 439 15-07-23, 02:52 PM
آخر رد: أبووسم
  يوجد خطاء عند تحميل الفورم - مثال شجرة الحسابات new_programer 6 756 11-06-23, 06:47 PM
آخر رد: new_programer
  يوجد خطاء عند فتح الفورم مثال شجرة الحسابات new_programer 2 564 06-06-23, 02:41 PM
آخر رد: new_programer
  مثال حفظ فاتورة المشتريات بكامل التفاصيل +اجراء مخزن -الكود محتاج تعديل new_programer 5 715 12-05-23, 09:25 PM
آخر رد: new_programer
  مثال بسيط لربط قواعد mySql مع Vb.net atefkhalf2004 2 396 17-04-23, 01:03 AM
آخر رد: atefkhalf2004
Lightbulb [VB.NET] سؤال وارجو المساعدة بخصوص عرض الصورة في تقرير كرستال younus 1 396 27-03-23, 10:13 PM
آخر رد: sanyor77

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم