datagridview某列编辑时显示为大写

void  dataGridView1_EditingControlShowing( object  sender, DataGridViewEditingControlShowingEventArgs e)
        {
            DataGridView dgv 
=  (DataGridView)sender;
            
if  (e.Control  is  DataGridViewTextBoxEditingControl)
            {
                DataGridViewTextBoxEditingControl editControl 
=  (DataGridViewTextBoxEditingControl)e.Control;
                
if  (dgv.CurrentCell.OwningColumn.Name  ==   " Column1 " )
                {
                    editControl.CharacterCasing 
=  CharacterCasing.Upper;
                }
                
else
                {
                    editControl.CharacterCasing 
=  CharacterCasing.Normal;
                }
            }
        }

你可能感兴趣的:(datagridview)