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

السلام عليكم

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


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


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

.rar   WindowsApp27.rar (الحجم : 62.27 ك ب / التحميلات : 37)
الرد }}}
تم الشكر بواسطة:
#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
الرد }}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  [سؤال] يوجد مثال|كيف نعيد صياغة نص ليكون تاريخ مقبول justforit 7 296 01-11-25, 10:54 PM
آخر رد: justforit
  [VB.NET] مثال و مشكلة (تشفير نص) mmaalmesry 5 896 09-05-25, 08:05 AM
آخر رد: mmaalmesry
  ارجو تعديل الكود جلب البيانات عن طريق اجراء مخزن - مرفق مثال new_programer 0 619 05-02-25, 01:51 AM
آخر رد: new_programer
  اريد جلب عدد محدد من السجلات من قاعدة بيانات اكسس الى الداتا قراد فيو يوجد مثال khalidalwdi 2 665 12-11-24, 12:19 PM
آخر رد: khalidalwdi
  ارجو المساعدة في فك تسفير ملف xml mimomassa17 0 209 15-09-24, 03:23 PM
آخر رد: mimomassa17
  ارجو المساعدة في كود مقارنة عامود داخل الداتا جريد فيو alachk 11 1,076 11-08-24, 11:44 AM
آخر رد: alachk
  المساعدة في عملية طرح الوقت من خلال اثنين textbox جيولوجي مبتدئ 9 2,757 06-08-24, 07:43 PM
آخر رد: خالد كامل1
  [VB.NET] ممكن المساعدة في اجراء بحث كومبوبكس وتيكست raedre22 20 1,115 18-07-24, 12:18 PM
آخر رد: raedre22
  اريد اضافة حفظ PDF فى مسار على الهارد- مثال الاستاذ عبدالله الدوسري new_programer 1 512 28-04-24, 04:52 PM
آخر رد: new_programer
  مرفق سورس كود ارسال ملفات الى الواتس بدون API new_programer 4 870 28-04-24, 06:31 AM
آخر رد: new_programer

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


يقوم بقرائة الموضوع: