To edit the contents of any cell in a column, you must use the EditingControlShowing event in the Datagridview. Using this event, you can trigger a keypress event in a specific cell. In the keypress event, you can apply a rule that automatically converts lowercase letters to uppercase.
Here are the steps for doing this:
EditingControlShowing , , . , - 2- .
private void TestDataGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if(TestDataGridView.CurrentCell.ColumnIndex.Equals(1))
{
e.Control.KeyPress += Control_KeyPress;
}
}
private static void Control_KeyPress(object sender, KeyPressEventArgs e)
{
}
CharacterCasing , , KeyPress , if . KeyPress.
:
if(e.Control is TextBox)
{
((TextBox) (e.Control)).CharacterCasing = CharacterCasing.Upper;
}