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 8184145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:24:02+00:00 2026-06-07T01:24:02+00:00

Using a DataGridView, how can I make a specific column uneditable while the grid

  • 0

Using a DataGridView, how can I make a specific column uneditable while the grid view itself has “Allow editing” enabled?

Also, how can I execute an event when the selected index in a ComboBox in the DataGridView has changed? Here, ComboBox is a column type.

Another question is, how can I make the header title aligned to the center? I can’t find the appropriate property.

  • 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-07T01:24:04+00:00Added an answer on June 7, 2026 at 1:24 am

    You’ve got a few questions here.

    (1) How can I make a specific column uneditable in DataGridView?

    Set the ReadOnly flag on the particular column you want to make uneditable.

    dataGridView.Columns["YourColumnName"].ReadOnly = true;
    

    (2) How can I execute an event when the selected index on a ComboBox in the DataGridView changes?

    If it’s in your DataGridView, it’s not a ComboBox; it’s a DataGridViewComboBoxColumn. According to MSDN:

    Unlike the ComboBox control, the DataGridViewComboBoxCell does not have SelectedIndex and SelectedValue properties. Instead, selecting a value from a drop-down list sets the cell Value property.

    This one I’m not familiar with, as I’ve never tried it myself. It appears you want to subscribe to the EditingControlShowing event and then see if something like this works for you (with a little tweaking).

    (3) How can I make the header title align in the center?

    Set the HeaderCell.Style.Alignment

    dataGridView.Columns["YourColumnName"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering if when using the datagridview control you can remove the thing
How can implement reordring in winforms datagridview by using the feature of drag and
I have a DataGridView in my app and I can't scroll it using the
I have an application that can filter a datagridview based on date using a
how can you dynamically add items to a combobox using the datagridview virtual mode?
How can I show files and their path in DataGridView without using web page?
I am using View as a Data Source to my DataGridView and I want
I am naming each column in a datagridview using a right-click menu with all
I am trying to make the column headers of my DataGridView bold, in Visual
I am using datagridview and its datasource is a BindingList. But when I try

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.