Reputation: 41
I have a datagridview with textboxcell. When I enter the cell and type a string it only shows the last char of the string. It replaces the last char with the new char. In order to write a complete string I need to click on other cell of any other part in the form, and then double click the textbox cell again and I can write a whole string.
Does anyone have an idea why is that?
Upvotes: 0
Views: 751
Reputation: 41
I recently ran into this behavior due to executing datagridview1.CommitEdit(DataGridViewDataErrorContexts.Commit) in the grid's CurrentCellDirtyStateChanged event handler. Any time I typed, it would only display one character, and I'd have to click out of the cell and back in to add additional text beyond the 1st character.
In my case, I'd added this code a while back to solve a problem that no longer existed, and had forgotten to remove it. Removing it resolved this behavior.
Upvotes: 1