Private Sub dgvDetail_CellFormatting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles dgvDetail.CellFormatting
If e.ColumnIndex = -1 Then Exit Sub
If dgvDetail.Columns(e.ColumnIndex).Name = "ReceiveDate" Then
e.CellStyle.Format = "D"
End If
If dgvDetail.Columns(e.ColumnIndex).Name = "Total" Then
e.CellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
e.CellStyle.Format = "#,##0.00"
End If
End Sub