Why there is no text in rows? How to make text in rows bold?
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.dataGridView1.AutoGenerateColumns = false;
this.dataGridView1.Columns.Add(new DataGridViewColumn { HeaderText = "Test", CellTemplate = new DataGridViewTextBoxCell() { }, DefaultCellStyle = new DataGridViewCellStyle { Font = new Font("Tahoma", 9.75F, FontStyle.Bold) } });
this.dataGridView1.DataSource = new List<Employee>
{
new Employee {Name="Test"},
new Employee {Name="Test"},
new Employee {Name="Test"},
new Employee {Name="Test"},
new Employee {Name="Test"},
new Employee {Name="Test"},
new Employee {Name="Test"}
};
}
}
public class Employee
{
public string Name { get; set; }
public int Number { get; set; }
}
}