DataGridView Sorting on multiple columns?

Posted on 2006-04-27
Last Modified: 2013-12-25
How can I sort my DataGridView based on three columns?
Question by:rrr333222
    LVL 44

    Expert Comment

    Hi rrr333222,

    the question on the multiple column sort can be found in the DGV FAQ here, with a large sample of code

    hope this helps a bit

    Author Comment

    hummm I had seen this when I did a google search but since I don't know c/c++ this language example is not totaly clear to me.
    LVL 2

    Accepted Solution

    why not make a hidden column that has the columns you want to sort on concatinated and then sort on that column?
    Here is how to sort on a column:
    Me.DataGridView3.Sort(Me.DataGridView3.Columns("SortCol"), System.ComponentModel.ListSortDirection.Ascending)

    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.

    Join & Write a Comment

    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    728 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

    17 Experts available now in Live!

    Get 1:1 Help Now