troubleshooting Question

CharacterCasing DataGridView VB.NET

Avatar of Thomas Swaney
Thomas SwaneyFlag for United States of America asked on
Programming.NET ProgrammingMicrosoft Development
8 Comments2 Solutions2783 ViewsLast Modified:
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
      DirectCast(e.Control, TextBox).CharacterCasing = CharacterCasing.Normal
End If
Thomas Swaney

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros