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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:15:01+00:00 2026-05-13T00:15:01+00:00

I want to be able to sort a DataGridView by the ComboBoxColumn so I

  • 0

I want to be able to sort a DataGridView by the ComboBoxColumn so I can display groups based on the value in the ComboBoxColumn. When I click the ComboBoxColumn, the DataGridView does not respond unlike the other columns which are TextBoxColumns. Meaning, it does not sort when I click the column header.

How can I provide this feature or do I have to override the functionality of the column with my own custom class?

  • 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-05-13T00:15:01+00:00Added an answer on May 13, 2026 at 12:15 am

    I just prototyped this very quickly, by adding an unbound DataGridView to a form, then adding four columns, two textbox columns and two combobox columns.

    The entire code-behind is shown below:

    public partial class Form1 : Form
    {
    
        public Form1()
        {
            InitializeComponent();
            DataGridViewComboBoxColumn col = (DataGridViewComboBoxColumn) dataGridView1.Columns[1];
            DataGridViewComboBoxColumn col2 = (DataGridViewComboBoxColumn)dataGridView1.Columns[2];
            List<string> items = new List<string>(){"B", "C", "E", "A"};
            col.DataSource = items;
            col.SortMode = DataGridViewColumnSortMode.Automatic;
            col2.DataSource = items;
            col2.SortMode = DataGridViewColumnSortMode.Automatic;
    
            dataGridView1.Rows.Add(new string[] {"A", "B", "C", "D"});
            dataGridView1.Rows.Add(new string[] { "B", "C", "C", "F" });
            dataGridView1.Rows.Add(new string[] { "C", "B", "A", "A" });
        }        
    }
    

    The sorting is working perfectly for me in this very simple example.

    You may need to post code examples to narrow down what the difference is in your code.

    One possible I can think of is that I’m binding to a list of strings, not objects.

    According to the documentation you can also provide your own custom handler for the SortCompare event.

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

Sidebar

Related Questions

I want to be able to sort files based on what day they were
I want to be able to sort elements based on an attribute in my
I want people to be able to sort things and not just me sorting
How can i do this? (c#) Basically, i want to be able to sort
I want a dict or tuple I can sort based on attributes of the
I have main categories and sub categories. I want to be able to sort
I have a list of divs that I want to be able to sort.
I have a list of userprofiles that I want to be able to sort
Story: I have a list of products. I want to be able to sort
I want to be able to sort my models in a collection first by

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.