How to send to clipboard datagridview content like CTRL-C
问题 How to send to clipboard selected content from DataGridView, simulating CTRL-C behavior. This isn't working as expected: Clipboard.SetText(this.dataGridView1.SelectedCells.ToString()); User needs to paste in Excel. CTRL-C is working fine, but I need to script for context menu. 回答1: SelectedCells is a CellCollection and as such has no useful ToString method. If you want to copy just one cell you have to decide which and then copy its Value , e.g.: Clipboard.SetText(this.dataGridView1