I have the following form which has a notes column, raise the CellFormatting event to add a ToolTipTex
That is, when I pass the mouse over the cell, it shows me the content in a ToolTip
The following image shows that when I pass the mouse over the cell that has the * it shows me the message Hello World in the tooltip
Code
private voidDataGridView1_CellFormatting(objectsender,DataGridViewCellFormattingEventArs e)
{
if ((e.ColumnIndex == this.dataGridView1.Columns["Notas"].Index)
&& e.Value != null)
{
DataGridViewCell cell =
this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex];
if (e.Value.Equals("*"))
{
cell.ToolTipText = "Hola Mundo";
}
}
}
How can I make it show me the content of the cell? In the code it says that if there is a * in the cell, show hello world, but what I need is to show me the content whatever the user enters, that is to say if the user enters hello how are you show me the same
You can enter the following