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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:07:02+00:00 2026-06-08T20:07:02+00:00

I have a DataGridViewComboBoxColumn object which serves as a datasource for one of the

  • 0

I have a DataGridViewComboBoxColumn object which serves as a datasource for one of the columns in my gridview.

The code is as follows:

DataGridViewComboBoxColumn comboBoxColumn = new DataGridViewComboBoxColumn();

comboBoxColumn.DataSource = Enum.GetValues(typeof(MyEnums));
comboBoxColumn.DataPropertyName = "MyPropertyName";
comboBoxColumn.Name = "My Column Name";

dataGridView.Columns["MyPropertyName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
//dataGridView.Columns["MyPropertyName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
//dataGridView.Columns["MyPropertyName"].Width = CalculateColumnWidthFromEnum(typeof(MyEnums));
dataGridView.Columns.Remove(dataGridView.Columns["MyPropertyName"]);
dataGridView.Columns.Insert(1, comboBoxColumn);

I am happy with how WinForms displays my enums appropriately and whatnot. However, the words describing my enums will be cut short and only expand if I open the drop down and then leave that control.

I also tried manually setting the width (as shown by the commented-out lines) and that had no effect

I have two columns like this in my grid view.

Am I missing something here?

  • 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-08T20:07:05+00:00Added an answer on June 8, 2026 at 8:07 pm

    I had the approach all wrong.

    I was adjusting the width of a column I removed

    dataGridView.Columns.Remove(dataGridView.Columns["MyPropertyName"]);
    

    Instead I should have set the column width using the comboBoxColumn as such:

    comboBoxColumn.Width = whateverWidthIwant;
    

    Thanks for everyone’s help!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataGridView where one of the columns is a DataGridViewComboBoxColumn . When
I have a DataGridView which allows the user to add a new object to
I have a DataGridView with a few DataGridViewComboBoxColumn's. The columns have their DataSource set
I have a custom object with several properties, one of which returns a list.
I have a DataGridview with several columns, and one of the column is DataGridViewComboBoxColumn.
have written this little class, which generates a UUID every time an object of
Have deployed numerous report parts which reference the same view however one of them
I have a datagridview with three columns which is filled using Datareader. There is
I have a DataGridView which has different rows and columns and it work perfectly
Have a simple one-off tasks which needs a progress bar. OpenSSL has a useful

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.