data grid view header text font size,back color problem

data grid view header text font size,back color problem

i have taken a grid and to that grid i am binding a table from the sql server database 2005

the tabel contains 25 columns

my requirement is to each column header the header text font size should be different

for example the column1 should have font size of 10

for example the column should have font size of 11

for example the column1 should have font size of 12

so - on

and in the same way for column 1 header backcolor should be different for all the columns

for example the column1 should have back color of green

for example the column1 should have back color of red

for example the column1 should have back color of yello

so-on

i am using vb.net 2005

can any one in dotnet solve this problem

i dont understand how to solve this problem

[898 byte] By [Rajeshbatchu] at [2007-12-28]
# 1

To set the backcolour you need to set EnableHeadersVisualStyles to False. Then something like this can be used:

DataGridView1.EnableHeadersVisualStyles = False
With DataGridView1.Columns(0).HeaderCell.Style
.Font = New Font("Arial", 10, FontStyle.Bold)
.BackColor = Color.Green
End With

Dave299 at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2

sorry i did not check properly

DataGridView1.Columns(X).HeaderCell.Style.Font = New Font("Microsoft Sans Serif", 35, FontStyle.Regular, GraphicsUnit.Point)

is the ans

Rajeshbatchu at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...