dataGridView1.Columns[0].HeaderCell.Value = "!!!";
dataGridView1.Rows[0].HeaderCell.Value = "===";
dataGridView1.TopLeftHeaderCell.Value = "????";
//除了DataGridViewClipboardCopyMode.Disable样式的其他样式
dataGridView1.ClipboardCopyMode = DataGridViewClipboardCopyMode.Disable ;//按住Control-C即可将数据写入剪贴板中
Clipboard.SetDataObject(dataGridView1.GetClipboardContent());//将数据提交到剪贴板,视情况而定该代码有没有
//取值
IDataObject i= Clipboard.GetDataObject();
if (i.GetDataPresent(DataFormats.Text))
textBox1.Text = i.GetData(DataFormats.Text).ToString();
else if (i.GetDataPresent(DataFormats.Html))
textBox1.Text = i.GetData(DataFormats.Html).ToString();
//更简单的取值
textBox1.Text = Clipboard.GetText();
private void dataGridView1_CellParsing(object sender, DataGridViewCellParsingEventArgs e)
{
e.Value = e.Value.ToString().ToUpper();
e.ParsingApplied = true;
}