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

نسخة كاملة : التأكد من عدم ترك خانة فارغة بالداتا جريد
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
السلام عليكم ورحمة الله وبركاته
هذه داتا جريد يستخدمها المستخدم في ادخال البيانات
اريد التأكد من عدم ترك خلية فارغة ؟؟
جرب الكود التالي :


كود :
Private Sub myDataGridView_CellValidating(ByVal sender As Object,
              ByVal e As DataGridViewCellValidatingEventArgs)
              Handles myDataGridView.CellValidating
   If myDataGridView.Item(e.ColumnIndex, e.RowIndex).Value Is Nothing Then
       ' Show the user a message
       MessageBox.Show("You have left the cell empty")

       ' Fail validation (prevent them from leaving the cell)
       e.Cancel = True
   End If
End Sub
(08-06-17, 10:11 PM)boudyonline كتب : [ -> ]جرب الكود التالي :


كود :
Private Sub myDataGridView_CellValidating(ByVal sender As Object,
              ByVal e As DataGridViewCellValidatingEventArgs)
              Handles myDataGridView.CellValidating
   If myDataGridView.Item(e.ColumnIndex, e.RowIndex).Value Is Nothing Then
       ' Show the user a message
       MessageBox.Show("You have left the cell empty")

       ' Fail validation (prevent them from leaving the cell)
       e.Cancel = True
   End If
End Sub

جزاك الله خيرا اخي الكريم  جاري التنفيذ