Solved

datagridview1 visual studio vb 2010 ultimate multi column sort

Posted on 2010-09-16
9
532 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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 500 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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

695 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