I got this code:
private void Form1_Load(object sender, EventArgs e)
{
dataGridView1.Columns.Add(new DataGridViewColumn(new DataGridViewTextBoxCell()));
List<string> carList = new List<string> { "car1 = red " + '\n'+ "car1 = blue", "car2 = green " + '\n' + "car2 = beige" };
foreach (string car in carList)
{
dataGridView1.Rows.Add(car);
}
}
When my form is loaded i want to display the cell value something like
First cell content:
car1 = red ,
car1 = blue
Second cell content:
car2 = green,
car2 = beige
Having the above code the cell content appears as a one line string but interesting is that the content of the cell's tooltip gets the text format that I want.
This is a sample picture with my result:
How could I get the same format (as the one from the tooltip) also for the text from the cell ?