Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8895415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:46:24+00:00 2026-06-14T23:46:24+00:00

Im trying to Programaticly change the DataGridViews Cell Header font style The Col headers

  • 0

Im trying to Programaticly change the DataGridViews “Cell Header” font style
The Col headers have to be UpperCase and I want to assign a new font.
If someone has done this before I would appreciate your guidance here.

Update

Actually the font changing works fine its just the headerText.ToUpper() I need help with

private void dataGridView1_Painting(object sender, DataGridViewCellPaintingEventArgs e)
{
            //Something like this.
           foreach(DataGridViewColumnCollection c in grd.Columns) {
               c.ColHeading.Text = c.ColHeading.Text.ToUpper(); 
           }

            //or
            //header row only
            if (e.RowIndex == -1)
            { 
                e.CellStyle.Font = new Font("Verdana", 11.0f);
                e.CellStyle.ForeColor = Color.Gray;
                e.Value = e.Value.ToUpper(); //fails as its a read only object
            }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:46:25+00:00Added an answer on June 14, 2026 at 11:46 pm

    Not familiar with this control, but browse other events. May not be making this change early enough, and have better luck with an “earlier” event.

    There may be events on the rows or columns themselves that you should be wiring up to to accomplish this.

    IEnumerable’s solution as per comment:

    dataGridView1_ColumnAdded(object sender, DataGridViewColumnEventArgs e) { e.Column.HeaderText = e.Column.HeaderText.ToUpper(); }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to do a application-wide font change and creating a style file
I'm trying to change the text alignment and the font size of a DataGridView.
I am new to iPhone programming. what I am trying is I have one
I'm trying to programatically change the text of an edit control in a 'Save
I am trying to change my ipad apps button title programatically using the following
I am trying to programatically unzip a zipped file. I have tried using the
I'm trying to programatically select/change the tab of the UITabViewController. I tried doing it
I have a gridview and I would like to be able to programatically change
I'm trying to change the appearance of my UIButtons int the view as well
Hi i am creating a UIButton programatically and I am trying to change the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.