Results 1 to 3 of 3

Thread: [RESOLVED] Is it possible to sort a DataGridView firstly by Column1, and then Column2?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    69

    Resolved [RESOLVED] Is it possible to sort a DataGridView firstly by Column1, and then Column2?

    Is it possible to sort a DataGridView firstly by Column1, and then Column2?

    Over here, I need to Sort by Job_Status desc order first, then by LeadTime Asc order

    So the URGENT jobs with the EARLIEST LeadTime should be at the TOP.

    LeadTime JobStatus

    5 May Urgent
    6 May Urgent
    9 May Urgent
    11 May Urgent
    12 May Urgent
    8 May On Hold

    Name:  Sort.jpg
Views: 343
Size:  28.8 KB

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Is it possible to sort a DataGridView firstly by Column1, and then Column2?

    How did you populate the grid in the first place?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    69

    Re: Is it possible to sort a DataGridView firstly by Column1, and then Column2?

    It's ok, I found the answer.

    Code:
    ProjectsBindingSource.Sort() = "Job_Status DESC, Lead_Time"

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width