VS 2008. I have the following two columns in my datagridview. No matter what order I add them to my grid, whichever is the second column only allows me to enter two characters, not 20. I can even separate them by another column and it has no effect. I am using an SQL data adapter to get the data from the database. I can also open the table in SQL and enter 20 characters and they show up in the grid, but when I try and change the value in the grid it only allows 2 characters. I have a couple of other coulumns in the same grid and they work fine. Any ideas? Is my grid or form corrupted? Am I missing something obvious?
Auguy
Sylvania/Toledo Ohio
Code:
Dim dgvTextBox As DataGridViewTextBoxColumn
... More columns
dgvTextBox = New DataGridViewTextBoxColumn
dgvTextBox.Name = "SerialNbr1"
dgvTextBox.HeaderText = "Serial # Part 1"
dgvTextBox.Width = 90
dgvTextBox.MaxInputLength = 20
dgvTextBox.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft
dgvTextBox.DataPropertyName = "SerialNbr1"
dgvTextBox.Visible = True
dgvUnit.Columns.Add(dgvTextBox)
ColCount = ColCount + 1
SerialNbr1ColNbr = ColCount
dgvTextBox = New DataGridViewTextBoxColumn
dgvTextBox.Name = "SerialNbr2"
dgvTextBox.HeaderText = "Serial # Part 2"
dgvTextBox.Width = 90
dgvTextBox.MaxInputLength = 20
dgvTextBox.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft
dgvTextBox.DataPropertyName = "SerialNbr2"
dgvTextBox.Visible = True
dgvUnit.Columns.Add(dgvTextBox)
ColCount = ColCount + 1
SerialNbr2ColNbr = ColCount
... More columns
dgvUnit.DataSource = bsDetail
Auguy
Sylvania/Toledo Ohio