I have a DataGridView where the units can be entered in a TextBox column.
DataGridView
TextBox
How do I restrict the input length of this column to 6 characters?
6
Use the MaxInputLength property of the DataGridViewTextBoxColumn.
MaxInputLength
DataGridViewTextBoxColumn
This property is available through the Designer or through code:
((DataGridViewTextBoxColumn)dataGridView1.Columns[yourColumn]).MaxInputLength = 6;
2.1m questions
2.1m answers
60 comments
57.0k users