I hope that someone can help with this issue.
I have a simple grid with three columns. I want only Column 2 (index 1) to be uppercase.
In the EditingControlShowing Event I have the following code which effectively sets the text when typing to uppercase although when clicking in Column 1 (index 0) or Column 3 (index 2) the text is capitalized before starting editing. In these columns the text that is entered when typing is lowercase once you have entered the cell although the text that was capitalized on initial entry is still capitalized. Any suggestions would be greatly appreciated.
If TypeOf e.Control Is TextBox And UlfDataGridView.Columns(UlfDataGridView.CurrentCell.ColumnIndex).Name = "DbloginnameDataGridViewTextBoxColumn" Then
DirectCast(e.Control, TextBox).CharacterCasing = CharacterCasing.Upper
Else
DirectCast(e.Control, TextBox).CharacterCasing = CharacterCasing.Normal
End If
Is there a way to set the TextBox control's charactercasing back to normal when the cell gets focus or leaving the cell (cellendedit)? I can't seem to figure out how this would be done. I am new to VB.NET programming.
The problem that I am having there is that I can't seem to reference the textbox. In other words if I tried to use the following code it will not work because e is set to ByVal e As System.Windows.Forms.DataG
DirectCast(e.Control, TextBox).CharacterCasing = CharacterCasing.Normal