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

x
?
Solved

datagridview1 visual studio vb 2010 ultimate multi column sort

Posted on 2010-09-16
9
Medium Priority
?
539 Views
Last Modified: 2012-05-10
I need to be able to sort on 2 columns at the same time like you can in excel sorting.  how can i achieve this?
0
Comment
Question by:mphillip85
9 Comments
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33698479
is your datagridview databound?
When the DataGridView control is bound to an external data source by setting the DataSource property, the Sort(DataGridViewColumn,ListSortDirection) method overload does not work for unbound columns. Additionally, when the VirtualMode property is true, you can call this overload only for bound columns. To determine whether a column is data-bound, check the IsDataBound property value. Sorting unbound columns in bound mode is not supported.
so you can use
Me.DataGridView1.Sort(Me.DataGridView1.Columns("SortCol"), System.ComponentModel.ListSortDirection.Ascending)
0
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33698503
the link is for gridview not datagridview
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33698523
0
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33698538
You may read my attchment..VERY HELPFULL
DGV-Sort.docx
0
 
LVL 17

Expert Comment

by:Zhaolai
ID: 33698540
0
 
LVL 18

Accepted Solution

by:
John (Yiannis) Toutountzoglou earned 2000 total points
ID: 33698549
@Zhaolai
"Here is the solution:
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Controls/Q_21830168.html"
It exaclty my first Post :)
0
 
LVL 17

Expert Comment

by:Zhaolai
ID: 33700940
Ah, @jtoutou, but you did not explain how to implement it.
0
 

Author Closing Comment

by:mphillip85
ID: 33750398
it has helped me to work out a scenario to use against the dgview multi column sort.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Loops Section Overview
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

872 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