datagridview not sorting on combobox columns

Posted on 2009-12-29
Last Modified: 2012-05-08

I have a datagridview with textbox columns and combo box columns. For some reason, the datagridview is not sorting on the combobox columns.
Column headerclick to sort is not working for comboboxcolumns.
What might be the prolem?

Question by:shahjagat
    LVL 10

    Accepted Solution

    check properties of the DataGridViewColumn.
    there must be a mistake in the code as normally DataGridView supports soring ComboBox columns
    LVL 10

    Assisted Solution

    The combobox will sort automatically if you set the DataGridViewColumn.SortMode Property to DataGridViewColumnSortMode.Automatic. The datagridview combobox column sorts on value of the column it is bound too. That is, If you bind a datasource such as DataTable and set the DisplayMember and Value member proerpties, the sorting will happen on ValueMember. Check the SortMode property.

    Also please check the following memebers.

    Sorting a DataGridView by DataGridViewComboxBoxColumn
    DataGridView: Sort a combobox column
    Sorting Bound DataGridView by ComboBoxColumn displayMember

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Flash ( has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
    Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now