views:

615

answers:

3

I want to change the backcolor of a headercell in datagridview row .So how can i do that in code C#?

A: 

I found it lolz

dataGridView1.Rows[index].HeaderCell.Style.BackColor = System.Drawing.Color.Red;

But now can anyone tell me how do i change font properties of the text named as value of the headercell like " headercell.value "

Mobin
A: 

To change the font properties of a specified header cell you can try:

dataGridView1.Columns[index].HeaderCell.Style.Font = new Font("Arial", 24, , FontStyle.Bold);
Robert Höglund
A: 

you can try this

dataGridView1.EnableHeadersVisualStyles = false; dataGridView1.Columns[index].HeaderCell.Style.Font = new Font("Arial", 24, , FontStyle.Bold);

Essar Patel