Based on somebody's answer to a previous question, I enforce character casing in datagridview cells as seen in the attached code.
Now I need to selectively enforce casing. That is, for colDesc1 I don't want to enforce casing whereas for colItemNo I do want to enforce casing.
I can't find a way to do this. I tried e.Control.Name, but it is an empty string. I noticed e.Control.Tag, but cannot assign a tag in the datagridview interface. I tried e.Control.Location, but that didn't work.
Any suggestions?
private void dgvMain_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { if (e.Control is TextBox) ((TextBox)e.Control).CharacterCasing = CharacterCasing.Upper; }
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
thanks for the help