17-09-19, 11:38 PM
جرّب هذه الطريقة يمكن تفيد إن شاء الله
كود :
Private Sub DGV_STUDENT_CellFormatting(sender As Object, e As DataGridViewCellFormattingEventArgs) Handles DGV_STUDENT.CellFormatting
' الطريقة الأولى
'If e.ColumnIndex = 8 Then
' Try
' If e.RowIndex = DGV_STUDENT.Rows.Count - 1 Then
' Exit Sub
' End If
' e.Value = CDate(e.Value)
' e.CellStyle.Format = "yyyy-MM-dd"
' Catch ex As Exception
' End Try
'End If
'الطريقة الثانية
If e.ColumnIndex = 8 Then
e.Value = CDate(e.Value).ToString("yyyy-MM-dd")
End If
End Subقناتنا على اليوتوب
