Link to home
Start Free TrialLog in
Avatar of Victor  Charles
Victor CharlesFlag for United States of America

asked on

Help with changing columns back color of DataGridView

Hi,

How do you change the backcolor of columns Headers if all the rows do not have identical data using VB.NET?

Thanks
Vicyor
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

You need to set to False before changing the colors (otherwise it has no effect):

		DataGridView1.EnableHeadersVisualStyles = False
		DataGridView1.Columns(1).HeaderCell.Style.BackColor = Color.Red

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Victor  Charles

ASKER

Hi,

How do you declare mdt?

Thanks,

Victor
at the top of my class
Dim mdt as DataTable

Open in new window

Thank you.