10-12-18, 06:10 AM
كود :
Private Sub DataGridView1_CellFormatting(sender As Object, e As DataGridViewCellFormattingEventArgs) Handles DataGridView1.CellFormatting
If e.ColumnIndex = 0 Then '0 = العمود الأول
If Not IsNothing(e.Value) AndAlso e.Value.ToString.Length > 18 Then
e.Value = e.Value.ToString.Substring(0, 18)
End If
End If
End Sub
