如何在单元格中添加评论DataGridView?我需要在网格中评论我的价值观。

通过设置该单元格的.ToolTipText属性,每个单元格都可以有一个工具提示。像这样的东西:
// Event for formatting cells when rendering the grid
void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
// Some logic for determining which cell this is in the row
if ((e.ColumnIndex == this.dataGridView1.Columns["SomeColumn"].Index))
{
// Get a reference to the cell
DataGridViewCell cell = this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex];
// Set the tooltip text
cell.ToolTipText = "some text";
}
}
在任何一个或任何你想要的文本上设置ToolTipText属性。DataGridViewCellDataGridViewColumn