[Webinar] Learn how to a build a cloud-first strategyRegister Now


datagridview not sorting on combobox columns

Posted on 2009-12-29
Medium Priority
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

lof earned 1000 total points
ID: 26141583
check properties of the DataGridViewColumn.
there must be a mistake in the code as normally DataGridView supports soring ComboBox columns
LVL 10

Assisted Solution

RameshS earned 1000 total points
ID: 26160821
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

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

864 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