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;
1.4m articles
1.4m replys
5 comments
57.0k users